tpm_put_ops(9)
π 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:
tpm_chip_start(9)tpm_chip_stop(9)tpm_try_get_ops(9)tpm_default_chip(9)tpm_dev_release(9)tpm_class_shutdown(9)tpm_chip_alloc(9)tpmm_chip_alloc(9)
(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_opsandtpm_try_get_opsare a matched pair. you let go, and the chip may getkfree'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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms