]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcache: remove dead code in detached_dev_do_request
authorShida Zhang <zhangshida@kylinos.cn>
Tue, 27 Jan 2026 08:21:11 +0000 (16:21 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Jan 2026 02:06:55 +0000 (19:06 -0700)
bio_alloc_clone() with GFP_NOIO and a mempool will not return NULL.
Remove the unnecessary NULL check.

Suggested-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/request.c

index a02aecac05cdf98036c58ebba2c6517c2eaad492..c2f38907a2a34af3f18862910a4613753fb641c4 100644 (file)
@@ -1113,11 +1113,6 @@ static void detached_dev_do_request(struct bcache_device *d,
 
        clone_bio = bio_alloc_clone(dc->bdev, orig_bio, GFP_NOIO,
                                    &d->bio_detached);
-       if (!clone_bio) {
-               orig_bio->bi_status = BLK_STS_RESOURCE;
-               bio_endio(orig_bio);
-               return;
-       }
 
        ddip = container_of(clone_bio, struct detached_dev_io_private, bio);
        /* Count on the bcache device */