提交 bf5e84f6 编写于 作者: D Dan Carpenter 提交者: James Bottomley

[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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 3b8b5c9b
...@@ -612,9 +612,9 @@ static int _osd_req_list_objects(struct osd_request *or, ...@@ -612,9 +612,9 @@ static int _osd_req_list_objects(struct osd_request *or,
WARN_ON(or->in.bio); WARN_ON(or->in.bio);
bio = bio_map_kern(q, list, len, or->alloc_flags); bio = bio_map_kern(q, list, len, or->alloc_flags);
if (!bio) { if (IS_ERR(bio)) {
OSD_ERR("!!! Failed to allocate list_objects BIO\n"); OSD_ERR("!!! Failed to allocate list_objects BIO\n");
return -ENOMEM; return PTR_ERR(bio);
} }
bio->bi_rw &= ~(1 << BIO_RW); bio->bi_rw &= ~(1 << BIO_RW);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册