Commit f3d8b53a authored by J. R. Okajima's avatar J. R. Okajima Committed by Pekka Enberg

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: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarJ. R. Okajima <hooanon05@yahoo.co.jp>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
parent 648f4e3e
......@@ -3109,7 +3109,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
* per-CPU caches is leaked, we need to make sure kmemleak doesn't
* treat the array pointers as a reference to the object.
*/
kmemleak_erase(&ac->entry[ac->avail]);
if (objp)
kmemleak_erase(&ac->entry[ac->avail]);
return objp;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment