Skip to content

Commit

Permalink
target: Make pscsi_create_virtdevice use ERR_CAST
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Dan Carpenter authored and Nicholas Bellinger committed Oct 24, 2011
1 parent 635a2b3 commit 942d826
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/target_core_pscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 942d826

Please sign in to comment.