From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> This patch updates up the remaining fabric module locations to use IS_ERR and PTR_ERR return values where necessary for transport_init_session(), Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> --- drivers/scsi/ibmvscsi/ibmvscsis.c | 2 +- drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c | 4 ++-- drivers/target/tcm_vhost/tcm_vhost_configfs.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvscsis.c b/drivers/scsi/ibmvscsi/ibmvscsis.c index beb15ca..7d701f4 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsis.c +++ b/drivers/scsi/ibmvscsi/ibmvscsis.c @@ -335,7 +335,7 @@ static struct se_portal_group *ibmvscsis_make_tpg(struct se_wwn *wwn, return ERR_PTR(-ENOMEM); adapter->se_sess = transport_init_session(); - if (!adapter->se_sess) { + if (IS_ERR(adapter->se_sess)) { core_tpg_deregister(&adapter->se_tpg); return ERR_PTR(-ENOMEM); } diff --git a/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c b/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c index f989110..1f0fe38 100644 --- a/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c +++ b/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c @@ -805,9 +805,9 @@ static int tcm_qla2xxx_check_initiator_node_acl( se_tpg = &tpg->se_tpg; se_sess = transport_init_session(); - if (!se_sess) { + if (IS_ERR(se_sess)) { pr_err("Unable to initialize struct se_session\n"); - return -ENOMEM; + return PTR_ERR(se_sess); } /* * Format the FCP Initiator port_name into colon seperated values to match diff --git a/drivers/target/tcm_vhost/tcm_vhost_configfs.c b/drivers/target/tcm_vhost/tcm_vhost_configfs.c index 719a362..b4e92e8 100644 --- a/drivers/target/tcm_vhost/tcm_vhost_configfs.c +++ b/drivers/target/tcm_vhost/tcm_vhost_configfs.c @@ -167,7 +167,7 @@ static int tcm_vhost_make_nexus( * Initialize the struct se_session pointer */ tv_nexus->tvn_se_sess = transport_init_session(); - if (!tv_nexus->tvn_se_sess) { + if (IS_ERR(tv_nexus->tvn_se_sess)) { mutex_unlock(&tv_tpg->tv_tpg_mutex); kfree(tv_nexus); return -ENOMEM; -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html