tpm_put_ops(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ tpm_put_ops β€” the Kernel API Manual, section 9, bestie πŸ’…

okay so we're in the Kernel API Manual (that's the manual name, section 9), and today's main character is tpm_put_ops. she's a tiny function with one job and she does it flawlessly. let's get into it ✨


🌸 NAME 🌸

tpm_put_ops β€” release a ref to the tpm_chip 🫢

like, you borrowed it, now give it back. be polite. periodt.


✨ SYNOPSIS ✨

void tpm_put_ops (struct tpm_chip *chip );

that's it. that's the whole signature. no cap, she's lowkey minimalist πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • chip β€” chip to put 🐣 (yes, literally "chip to put" β€” the one you're handing back, bestie)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is the opposite pair to tpm_try_get_ops. you know how tpm_try_get_ops grabs a ref? this is the other half of that situationship. they come as a set. matched set. iconic duo energy πŸ‘‘

and here's the part that actually matters: after this returns, chip may be kfree'd. 😭 like, the memory is free real estate now. gone. reclaimed. so do not go touching chip after you call this, because it might literally not exist anymore. that's not a vibe check you want to fail fr fr πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

the kernel file in question: ./drivers/char/tpm/tpm-chip.c β€” go read it, iykyk πŸ“–

and the whole friend group:

(and yes tpmm_chip_alloc(9) really has two m's up there β€” i don't make the rules, i just report them exactly as they are, character for character, no editing, we stan accuracy πŸ“)


bestie reminder: tpm_put_ops and tpm_try_get_ops are a matched pair. you let go, and the chip may get kfree'd immediately after. do not look back. do not dereference. walk away with main character energy 🧚

that's the whole page!! it lives in ./drivers/char/tpm, it's dated October 2026, and it's from the Kernel API Manual β€” mwah, sending you off with a kiss and a refcount that's finally balanced πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from