bio: safeguard REQ_ALLOC_CACHE bio put
[platform/kernel/linux-starfive.git] / block / bio.c
index 6c470a5..0a14af9 100644 (file)
@@ -741,7 +741,7 @@ void bio_put(struct bio *bio)
                        return;
        }
 
-       if (bio->bi_opf & REQ_ALLOC_CACHE) {
+       if ((bio->bi_opf & REQ_ALLOC_CACHE) && !WARN_ON_ONCE(in_interrupt())) {
                struct bio_alloc_cache *cache;
 
                bio_uninit(bio);