scsi: target: Remove unnecessary null checking for bio allocation
Subsystems (2)
PATCH v2 1/1 scsi: target: Remove unnecessary null checking for bio allocation
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 <[email protected]>
---
v1: https://lore.kernel.org/target-devel/[email protected]/T/#uv1->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(-)
drivers/target/target_core_iblock.c +0 -5
@@ -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;
Signature · 1 line
2.39.5 (Apple Git-154)