aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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