scsi/osd: checking NULL instead of ERR_PTR()
Subsystems (2)
PATCH 1/1 scsi/osd: checking NULL instead of ERR_PTR()
bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
drivers/scsi/osd/osd_initiator.c +2 -2
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)/* create a bio for continuation segment */ bio =bio_map_kern (req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,GFP_KERNEL ); -if (unlikely (!bio)) -return -ENOMEM ; +if (unlikely (IS_ERR (bio))) +return PTR_ERR (bio); bio->bi_rw |=REQ_WRITE ;
Quoted 4 lines · Dan Carpenter
bio_map_kern()returnsERR_PTRson failure and never returns NULL.Signed-off-by Dan Carpenter <[email protected]>
Quoted 5 lines
drivers/scsi/osd/osd_initiator.c +0
-0
drivers/scsi/osd/osd_initiator.c static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key) · line 958
Quoted 10 lines
drivers/scsi/osd/osd_initiator.c +2
-2@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)/* create a bio for continuation segment */ bio =bio_map_kern (req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,GFP_KERNEL ); -if (unlikely (!bio)) -return -ENOMEM ; +if (unlikely (IS_ERR (bio))) +return PTR_ERR (bio); bio->bi_rw |=REQ_WRITE ;
Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed for current Kernel.
James: please apply to scsi-rc-fixes for the next round of fixes?
Thanks
Boaz
Quoted 8 lines · Boaz Harrosh
Quoted 4 lines · Dan Carpenter
bio_map_kern()returnsERR_PTRson failure and never returns NULL.Signed-off-by Dan Carpenter <[email protected]>Acked-by Boaz Harrosh <[email protected]>
James! Please submit this patch for scsi-rc-fixes. It is an important fix for code that went into this merge window.
Thanks
Boaz
Quoted 23 lines
Quoted 5 lines
drivers/scsi/osd/osd_initiator.c +0
-0drivers/scsi/osd/osd_initiator.c static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key) · line 958
Quoted 10 lines
drivers/scsi/osd/osd_initiator.c +2
-2@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)/* create a bio for continuation segment */ bio =bio_map_kern (req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,GFP_KERNEL ); -if (unlikely (!bio)) -return -ENOMEM ; +if (unlikely (IS_ERR (bio))) +return PTR_ERR (bio); bio->bi_rw |=REQ_WRITE ;Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed for current Kernel.
James: please apply to scsi-rc-fixes for the next round of fixes?
Thanks
Boaz
Quoted 7 lines · Boaz Harrosh
Quoted 6 lines · Boaz Harrosh
Quoted 4 lines · Dan Carpenter
bio_map_kern()returnsERR_PTRson failure and never returns NULL.Signed-off-by Dan Carpenter <[email protected]>
Quoted 9 lines
Quoted 2 lines
Acked-by Boaz Harrosh <[email protected]>James! Please submit this patch for scsi-rc-fixes. It is an important fix for code that went into this merge window.
Thanks
Boaz
James, ping?
Quoted 28 lines
Quoted 19 lines
Quoted 5 lines
drivers/scsi/osd/osd_initiator.c +0
-0drivers/scsi/osd/osd_initiator.c static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key) · line 958
Quoted 10 lines
drivers/scsi/osd/osd_initiator.c +2
-2@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)/* create a bio for continuation segment */ bio =bio_map_kern (req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,GFP_KERNEL ); -if (unlikely (!bio)) -return -ENOMEM ; +if (unlikely (IS_ERR (bio))) +return PTR_ERR (bio); bio->bi_rw |=REQ_WRITE ;Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed for current Kernel.
Quoted 4 lines
James: please apply to scsi-rc-fixes for the next round of fixes?
Thanks
Boaz--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html