kmemleak_not_leak(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kmemleak_not_leak β€” the kernel API manual, bestie edition

okay so this is kmemleak_not_leak(9), straight out of the kernel API manual, and it's lowkey one of the most useful little guys in the whole leak-detector friend group 🫢


✨ NAME ✨

kmemleak_not_leak β€” mark an allocated object as a false positive πŸ’–

like, the leak detector was being a little dramatic and this is how you tell it "no babe, that one's fine" πŸŽ€


🌸 SYNOPSIS 🌸

void __ref kmemleak_not_leak (const void *ptr );

that's it. that's the whole vibe. no cap ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ptr β€” pointer to beginning of the object πŸ‘‘ (yes, the beginning, bestie, don't be out here handing it a random offset πŸ™ˆ)

πŸ’œ DESCRIPTION πŸ’œ

so the way this works: when you call this function on an object, the memory block will no longer be reported as leak and will always be scanned. periodt. πŸ’…

it's giving "i've reviewed this one personally and she's innocent" energy β€” you're clearing the block's name and telling the scanner to keep an eye on it anyway. iconic behavior, honestly 🌈

ngl, this is your go-to when a block looks lost but it's actually referenced somewhere kmemleak just can't see (iykyk 😭). you're vouching for it, so vouch responsibly πŸ“

⭐ SEE ALSO ⭐

kernel file ./mm/kmemleak.c β€” the source of truth, go read her πŸ‘‘

and the whole extended fam, fr fr:


🧚 sign-off 🧚

this page lives in ./mm, dated October 2026, and its whole title-slash-name is kmemleak_not_leak(9) β€” so go forth, mark your false positives, and slay πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from