]> 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)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 17 May 2012 15:20:24 +0000 (11:20 -0400)
commitf53308de9f3ddfff46671192f081751541498137
tree05f0be5927d88ce85d9d60db5aed8ddbe5b86a8d
parent8a6e54faf593e6a7526e16fe56deb4a29d7d172e
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: Paul Gortmaker <paul.gortmaker@windriver.com>
mm/kmemleak.c