Commit bf5e84f6 authored by Dan Carpenter's avatar Dan Carpenter Committed by James Bottomley
Browse files

[SCSI] libosd: fix potential ERR_PTR dereference in osd_initiator.c

bio_map_kern() returns an ERR_PTR() not NULL.

Found by smatch (

).  Compile tested.
Signed-off-by: default avatarDan Carpenter <>
Signed-off-by: default avatarBoaz Harrosh <>
Signed-off-by: default avatarJames Bottomley <>
parent 3b8b5c9b
......@@ -612,9 +612,9 @@ static int _osd_req_list_objects(struct osd_request *or,
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");
return -ENOMEM;
return PTR_ERR(bio);
bio->bi_rw &= ~(1 << BIO_RW);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment