Re: [PATCH 3/4] mm: kmemleak: factor leak confirmation into a helper
Catalin Marinas <[email protected]>
| Newsgroups | org.kernel.vger.workflows,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-kselftest,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jul 13, 2026 at 04:48:06AM -0700, Breno Leitao wrote: > The reporting loop in kmemleak_scan() decided whether to tag an object as > a reported leak with a four-term compound condition whose last operand > also had a side effect (++object->unref_scans). Mixing the candidate > tests with the counter update made the check hard to read. > > Move the state transition into confirm_leak(): it returns true when a > still-unreferenced suspect crosses min_unref_scans consecutive scans and > is newly flagged OBJECT_REPORTED, leaving only the reporting bookkeeping > in the caller. No functional change. > > Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Catalin Marinas <[email protected]>