]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kmemleak: Do not return a pointer to an object that kmemleak did not get
authorCatalin Marinas <catalin.marinas@arm.com>
Wed, 27 Apr 2011 15:44:26 +0000 (16:44 +0100)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:49 +0000 (13:54 -0700)
commit465e9df58b3007510231e030db6f622f4a46a6ac
treee32156bc2864880505d221c4f3799ec0f1f2af4d
parent6ea4870f102c97460c57cc9ae32d8e17a277baef
kmemleak: Do not return a pointer to an object that kmemleak did not get

commit 52c3ce4ec5601ee383a14f1485f6bac7b278896e upstream.

The kmemleak_seq_next() function tries to get an object (and increment
its use count) before returning it. If it could not get the last object
during list traversal (because it may have been freed), the function
should return NULL rather than a pointer to such object that it did not
get.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Acked-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
mm/kmemleak.c