devm_kfree(9)
π devm_kfree(9) β Resource-managed kfree π
okay bestie, welcome to the Kernel API Manual entry for devm_kfree(9). yes it's a whole nine-section manpage for a free function. iconic honestly. let's get into it π«Ά
β¨ NAME β¨
devm_kfree β Resource-managed kfree
like, it frees stuff, but the device is involved and it's all managed and cute about it. that's the whole vibe π
πΈ SYNOPSIS πΈ
void devm_kfree (struct device *dev , const void *p );
no cap, that's the entire signature. returns void, so no checking anything, it's giving "i simply do not report back" energy π
π ARGUMENTS π
devβ the Device this memory belongs to. it's the owner, the main character of this allocation's whole life story πpβ the Memory to free. literally just the pointer, hand it over and let it go π¦
β DESCRIPTION β
Free memory allocated with devm_kmalloc.
that's it. that's the description. sometimes the most powerful thing you can say is one sentence β¨ not me expecting more lore and getting exactly one line π but honestly? efficient. we love a concise queen.
π SEE ALSO π
bestie there are so many friends in this group chat, i'm obsessed. first up, the kernel file they all live in:
./drivers/base/devres.c
and now the whole squad of related calls, every single one, present and accounted for π«Ά
__devres_alloc_node(9)devres_for_each_res(9)devres_free(9)devres_add(9)devres_find(9)devres_get(9)devres_remove(9)devres_destroy(9)devres_release(9)devres_release_all(9)devres_open_group(9)devres_close_group(9)devres_remove_group(9)devres_release_group(9)__devm_add_action(9)devm_remove_action_nowarn(9)devm_release_action(9)devm_kmalloc(9)devm_krealloc(9)devm_kstrdup(9)devm_kstrdup_const(9)devm_kvasprintf(9)devm_kasprintf(9)devm_kmemdup(9)devm_kmemdup_const(9)devm_get_free_pages(9)devm_free_pages(9)__devm_alloc_percpu(9)
look at them. a whole family. devm_kmalloc(9) is literally the parent of this whole entry and i love that for them π
lowkey reminder bestie: this frees memory from devm_kmalloc, so keep the pairing straight in your head β the manpage says what it says, don't go inventing extra behaviour, i'm just the messenger π§
okay that's the whole page!! written under ./drivers/base, dated October 2026, and signed off with all the love in devm_kfree(9) β go free that memory, you've got this πβ¨π
π¦ 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