Message ID | 20250202152753.22685-1-enjuk@amazon.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] scsi: target: Remove unnecessary null checking for bio allocation | expand |
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index c8dc92a7d63e..a53e41212cdd 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -369,11 +369,6 @@ static struct bio *iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, */ bio = bio_alloc_bioset(ib_dev->ibd_bd, bio_max_segs(sg_num), opf, GFP_NOIO, &ib_dev->ibd_bio_set); - if (!bio) { - pr_err("Unable to allocate memory for bio\n"); - return NULL; - } - bio->bi_private = cmd; bio->bi_end_io = &iblock_bio_done; bio->bi_iter.bi_sector = lba;
Remove unnecessary null checking because bio_alloc_bioset() is guaranteed to succeed with __GFP_DIRECT_RECLAIM (included in GFP_NOIO). For more details, please see the comment in bio_alloc_bioset(). Signed-off-by: Kohei Enju <enjuk@amazon.com> --- v1: https://lore.kernel.org/target-devel/20250202090208.26890-1-enjuk@amazon.com/T/#u v1->v2: * Fix the commit message to use imperative mood * Remove the unnecessary blank line --- drivers/target/target_core_iblock.c | 5 ----- 1 file changed, 5 deletions(-)