Skip to content

Commit

Permalink
[SCSI] osd: checking NULL instead of ERR_PTR()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and James Bottomley committed Dec 9, 2010
1 parent 6313e3c commit 057f02a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/osd/osd_initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (IS_ERR(bio))
return PTR_ERR(bio);

bio->bi_rw |= REQ_WRITE;

Expand Down

0 comments on commit 057f02a

Please sign in to comment.