]> 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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:28:33 +0000 (15:28 -0700)
commitdee555dc331261ad9efbb672280406b863c8576d
treeb1700c87e927b6e5d9ab38036568544e5ae051df
parent7116a3c50456ac9634ce305fd51ad24fcbf13e58
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>
mm/kmemleak.c