drmm_kfree(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drmm_kfree(9) β€” like, the whole page, bestie πŸ’–

okay so real talk: this is a page out of the Kernel API Manual (yes, the actual kernel, we're being fancy today πŸ‘‘) and it's about drmm_kfree, which is genuinely one of the most useful little gremlins in the DRM toolbox. It's giving "cleanup crew but make it managed." Let's get into it ✨


🌸 NAME 🌸

drmm_kfree β€” the &drm_device managed version of kfree(). that's it. that's the whole vibe. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void drmm_kfree (struct drm_device *dev , void *data );

look at her. short, sweet, does exactly one thing. main character energy fr fr πŸŽ€


✨ ARGUMENTS ✨

  • dev β€” the DRM device. your little guy. the struct drm_device * that's holding the managed party together 🫢
  • data β€” the memory allocation that's getting freed. the thing you're sending off into the void 😭

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea: this is a drm_device managed version of kfree, and it's the one you reach for when you want to release memory that was allocated through drmm_kmalloc β€” or any of its related functions β€” before the final drm_dev_put of dev happens. 🧚

like, that's the whole point. the memory is already tracked by the device, and this is your "actually, I'd like this gone now please" button. no cap, it's that simple. πŸ”₯

bestie pls note: the timing detail is doing a lot of heavy lifting here β€” this one frees before that final drm_dev_put of dev. read that twice, it matters πŸ’€

⭐ SEE ALSO ⭐

iykyk β€” these are the whole family, they all hang out together πŸ“


πŸ’– and that's the page!! shoutout to ./drivers/gpu/drm for being the home of all this, and to October 2026 for the timestamp β€” mwah, periodt πŸ’…βœ¨πŸŒΈ
πŸ“¦ where this page comes from