mm/kasan, slub: don't disable interrupts when object leaves quarantine
[cascardo/linux.git] / mm / kasan / quarantine.c
index 65793f1..4852625 100644 (file)
@@ -147,10 +147,14 @@ static void qlink_free(struct qlist_node *qlink, struct kmem_cache *cache)
        struct kasan_alloc_meta *alloc_info = get_alloc_info(cache, object);
        unsigned long flags;
 
-       local_irq_save(flags);
+       if (IS_ENABLED(CONFIG_SLAB))
+               local_irq_save(flags);
+
        alloc_info->state = KASAN_STATE_FREE;
        ___cache_free(cache, object, _THIS_IP_);
-       local_irq_restore(flags);
+
+       if (IS_ENABLED(CONFIG_SLAB))
+               local_irq_restore(flags);
 }
 
 static void qlist_free_all(struct qlist_head *q, struct kmem_cache *cache)