Skip to content

Commit 057f02a

Browse files
error27James Bottomley
authored andcommitted
[SCSI] osd: checking NULL instead of ERR_PTR()
bio_map_kern() returns ERR_PTRs on failure and never returns NULL. [jejb: remove redundant unlikely spotted by Tobias Klauser] Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
1 parent 6313e3c commit 057f02a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/scsi/osd/osd_initiator.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
951951
/* create a bio for continuation segment */
952952
bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
953953
GFP_KERNEL);
954-
if (unlikely(!bio))
955-
return -ENOMEM;
954+
if (IS_ERR(bio))
955+
return PTR_ERR(bio);
956956

957957
bio->bi_rw |= REQ_WRITE;
958958

0 commit comments

Comments
 (0)