Skip to contentSkip to conversation

target: blk_make_request() returns an ERR_PTR()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 31, 2011 – Nov 2, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: blk_make_request() returns an ERR_PTR()

The check is wrong here because blk_make_request() returns an ERR_PTR() and it doesn't return NULL.

drivers/target/target_core_pscsi.c +1 -1
index b452efe..ed32e1e 100644
@@ -1092,7 +1092,7 @@ static int pscsi_do_task(struct se_task *task)
 
 		req = blk_make_request(pdv->pdv_sd->request_queue, hbio,
 				       GFP_KERNEL);
-		if (!req) {
+		if (IS_ERR(req)) {
 			pr_err("pSCSI: blk_make_request() failed\n");
 			goto fail;
 		}
#1 lore raw
Quoted 4 lines · Dan Carpenter

The check is wrong here because blk_make_request() returns an ERR_PTR() and it doesn't return NULL.

Applied and queuing for the next pull. Thanks Dan!

--nab