net/mlx5e: CQE based moderation
[cascardo/linux.git] / mm / slab.c
index c11bf50..cc8bbc1 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3547,9 +3547,17 @@ free_done:
 static inline void __cache_free(struct kmem_cache *cachep, void *objp,
                                unsigned long caller)
 {
-       struct array_cache *ac = cpu_cache_get(cachep);
+       /* Put the object into the quarantine, don't touch it for now. */
+       if (kasan_slab_free(cachep, objp))
+               return;
+
+       ___cache_free(cachep, objp, caller);
+}
 
-       kasan_slab_free(cachep, objp);
+void ___cache_free(struct kmem_cache *cachep, void *objp,
+               unsigned long caller)
+{
+       struct array_cache *ac = cpu_cache_get(cachep);
 
        check_irq_off();
        kmemleak_free_recursive(objp, cachep->flags);
@@ -4493,7 +4501,7 @@ size_t ksize(const void *objp)
        /* We assume that ksize callers could use the whole allocated area,
         * so we need to unpoison this area.
         */
-       kasan_krealloc(objp, size, GFP_NOWAIT);
+       kasan_unpoison_shadow(objp, size);
 
        return size;
 }