]> git.baikalelectronics.ru Git - kernel.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)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 19 May 2011 16:35:28 +0000 (17:35 +0100)
commit4962a9078c3f5f291c865211598e6706feff503e
treec987bc17100f9b5e5bdaa3b2b83612fe65bbb39a
parentd8ac14e0afa40bea8504e0817611b1680421dd34
kmemleak: Do not return a pointer to an object that kmemleak did not get

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>
Cc: <stable@kernel.org>
mm/kmemleak.c