Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -3109,6 +3109,7 @@ 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
	 * per-CPU caches is leaked, we need to make sure kmemleak doesn't
	 * treat the array pointers as a reference to the object.
	 * treat the array pointers as a reference to the object.
	 */
	 */
	if (objp)
		kmemleak_erase(&ac->entry[ac->avail]);
		kmemleak_erase(&ac->entry[ac->avail]);
	return objp;
	return objp;
}
}