aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorJ. R. Okajima <hooanon05@yahoo.co.jp>2009-12-02 02:55:49 -0500
committerPekka Enberg <penberg@cs.helsinki.fi>2009-12-06 03:23:05 -0500
commitf3d8b53a3abbfd0b74fa5dfaa690870d9619fad9 (patch)
tree0077e9af30a2fadf6d02da5420c9d979f80a3ee5 /mm/slab.c
parent648f4e3e50c4793d9dbf9a09afa193631f76fa26 (diff)
slab, kmemleak: stop calling kmemleak_erase() unconditionally
When the gotten object is NULL (probably due to ENOMEM), kmemleak_erase() is unnecessary here, It just sets NULL to where already is NULL. Add a condition. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 7dfa481c96ba..4e61449d7946 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3109,7 +3109,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
3109 * per-CPU caches is leaked, we need to make sure kmemleak doesn't 3109 * per-CPU caches is leaked, we need to make sure kmemleak doesn't
3110 * treat the array pointers as a reference to the object. 3110 * treat the array pointers as a reference to the object.
3111 */ 3111 */
3112 kmemleak_erase(&ac->entry[ac->avail]); 3112 if (objp)
3113 kmemleak_erase(&ac->entry[ac->avail]);
3113 return objp; 3114 return objp;
3114} 3115}
3115 3116