[PATCH v1] scsi: target: remove unnecessary null checking for bio allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When __GFP_DIRECT_RECLAIM (included in GFP_NOIO) is specified,
bio_alloc_bioset() never fails to allocate a bio. For more details, see
the comment in bio_alloc_bioset() in block/bio.c

Signed-off-by: Kohei Enju <enjuk@xxxxxxxxxx>
---
 drivers/target/target_core_iblock.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index c8dc92a7d63e..9ef23eea55e7 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -369,10 +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;
-- 
2.39.5 (Apple Git-154)





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux