]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
block: blocking mempool_alloc doesn't fail
authorChristoph Hellwig <hch@lst.de>
Mon, 3 Nov 2025 10:16:44 +0000 (05:16 -0500)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Nov 2025 19:40:46 +0000 (12:40 -0700)
So remove the error check for it in bio_integrity_prep.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio-integrity-auto.c

index 687952f63bbbfe7658fa50f3ee489cf9cd4ee268..2f4a244749ac9f971e1e6a0b65a7601f4b098318 100644 (file)
@@ -158,8 +158,6 @@ bool bio_integrity_prep(struct bio *bio)
        if (!buf)
                goto err_end_io;
        bid = mempool_alloc(&bid_pool, GFP_NOIO);
-       if (!bid)
-               goto err_free_buf;
        bio_integrity_init(bio, &bid->bip, &bid->bvec, 1);
 
        bid->bio = bio;
@@ -187,8 +185,6 @@ bool bio_integrity_prep(struct bio *bio)
                bid->saved_bio_iter = bio->bi_iter;
        return true;
 
-err_free_buf:
-       kfree(buf);
 err_end_io:
        bio->bi_status = BLK_STS_RESOURCE;
        bio_endio(bio);