target_fabric_configfs_init() never returns NULLs, only ERR_PTRs. Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index dcbcedc..08cf507 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1885,9 +1885,9 @@ static int tcm_qla2xxx_register_configfs(void) * Register the top level struct config_item_type for NPIV with TCM core */ npiv_fabric = target_fabric_configfs_init(THIS_MODULE, "qla2xxx_npiv"); - if (!npiv_fabric) { + if (IS_ERR(npiv_fabric)) { pr_err("target_fabric_configfs_init() failed\n"); - ret = -ENOMEM; + ret = PTR_ERR(npiv_fabric); goto out_fabric; } /* -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html