aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-04-19 12:07:47 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-27 12:05:31 -0400
commitbf5e84f69618f416e89a5a53434a8c865e70252e (patch)
tree589931c8a79c55f395fa25af94cbfc42c524de79 /drivers
parent3b8b5c9b1f08660583e5dfe095c24170df62f1d2 (diff)
[SCSI] libosd: fix potential ERR_PTR dereference in osd_initiator.c
bio_map_kern() returns an ERR_PTR() not NULL. Found by smatch (http://repo.or.cz/w/smatch.git). Compile tested. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/osd/osd_initiator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 2a5f0777148d..76de88962237 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -612,9 +612,9 @@ static int _osd_req_list_objects(struct osd_request *or,
612 612
613 WARN_ON(or->in.bio); 613 WARN_ON(or->in.bio);
614 bio = bio_map_kern(q, list, len, or->alloc_flags); 614 bio = bio_map_kern(q, list, len, or->alloc_flags);
615 if (!bio) { 615 if (IS_ERR(bio)) {
616 OSD_ERR("!!! Failed to allocate list_objects BIO\n"); 616 OSD_ERR("!!! Failed to allocate list_objects BIO\n");
617 return -ENOMEM; 617 return PTR_ERR(bio);
618 } 618 }
619 619
620 bio->bi_rw &= ~(1 << BIO_RW); 620 bio->bi_rw &= ~(1 << BIO_RW);