diff options
-rw-r--r-- | mm/slab.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 | ||