devm_kmemdup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

bestie, this is devm_kmemdup(9) from the Kernel API Manual, and it's literally the resource-managed glow-up of kmemdup πŸ’…

✨ NAME ✨

devm_kmemdup β€” resource-managed kmemdup (yes, the memory cleans up after itself, main character energy fr fr)

✨ SYNOPSIS ✨

void * devm_kmemdup (struct device *dev , const void *src , size_t len ,
gfp_t gfp );

✨ ARGUMENTS ✨

  • dev β€” the device this memory belongs to 🫢 (it's giving "this allocation is on your tab")
  • src β€” the memory region you wanna duplicate 🌸
  • len β€” how long that memory region is, bestie πŸ“
  • gfp β€” the GFP mask to use ✨

✨ DESCRIPTION ✨

Okay so what it does is duplicate a region of memory using resource-managed kmalloc πŸ’–. That's the whole vibe β€” it's kmemdup but with the devres magic so the memory is tracked against dev. Iconic behavior honestly.

✨ SEE ALSO ✨

lowkey the whole devres friend group is here, no cap 🫢 β€” kernel file ./drivers/base/devres.c plus:


and that's the whole page, bestie β€” source <pink>./drivers/base</pink>, dated October 2026, page devm_kmemdup(9). go forth and duplicate responsibly πŸ’œβœ¨

πŸ“¦ where this page comes from