From 942d82646e16725ac366d44087b8c992f2cb2190 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 2 Oct 2011 01:59:13 +0300 Subject: [PATCH] target: Make pscsi_create_virtdevice use ERR_CAST This patch changes pscsi_create_virtdevice() to properly return ERR_CAST instead of a raw pointer upon scsi_host_lookup() failure. Signed-off-by: Dan Carpenter Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_pscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index b6d609362d6..3898fb7d317 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -566,7 +566,7 @@ static struct se_device *pscsi_create_virtdevice( if (IS_ERR(sh)) { pr_err("pSCSI: Unable to locate" " pdv_host_id: %d\n", pdv->pdv_host_id); - return (struct se_device *) sh; + return ERR_CAST(sh); } } } else { -- 2.41.0