[PATCH 3/3] target: Fix err.h return handling for target_fabric_configfs_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

This patch updates remaining fabric module code to use IS_ERR and
PTR_ERR return values for target_fabric_configfs_init().

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
---
 drivers/scsi/ibmvscsi/ibmvscsis.c                 |    4 ++--
 drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c |    4 ++--
 drivers/target/tcm_vhost/tcm_vhost_configfs.c     |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvscsis.c b/drivers/scsi/ibmvscsi/ibmvscsis.c
index 7d701f4..dfdd57f 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsis.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsis.c
@@ -1624,9 +1624,9 @@ static int ibmvscsis_register_configfs(void)
 	 * Register the top level struct config_item_type with TCM core
 	 */
 	fabric = target_fabric_configfs_init(THIS_MODULE, "ibmvscsis");
-	if (!(fabric)) {
+	if (IS_ERR(fabric)) {
 		printk(KERN_ERR "target_fabric_configfs_init() failed\n");
-		return -ENOMEM;
+		return PTR_ERR(fabirc);
 	}
 	/*
 	 * Setup fabric->tf_ops from our local ibmvscsis_ops
diff --git a/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c b/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c
index 1f0fe38..97b6731 100644
--- a/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c
+++ b/drivers/target/tcm_qla2xxx/tcm_qla2xxx_configfs.c
@@ -1321,9 +1321,9 @@ static int tcm_qla2xxx_register_configfs(void)
 	 * Register the top level struct config_item_type with TCM core
 	 */
 	fabric = target_fabric_configfs_init(THIS_MODULE, "qla2xxx");
-	if (!fabric) {
+	if (IS_ERR(fabric)) {
 		pr_err("target_fabric_configfs_init() failed\n");
-		return -ENOMEM;
+		return PTR_ERR(fabric);
 	}
 	/*
 	 * Setup fabric->tf_ops from our local tcm_qla2xxx_ops
diff --git a/drivers/target/tcm_vhost/tcm_vhost_configfs.c b/drivers/target/tcm_vhost/tcm_vhost_configfs.c
index b4e92e8..7471d91 100644
--- a/drivers/target/tcm_vhost/tcm_vhost_configfs.c
+++ b/drivers/target/tcm_vhost/tcm_vhost_configfs.c
@@ -567,9 +567,9 @@ static int tcm_vhost_register_configfs(void)
 	 * Register the top level struct config_item_type with TCM core
 	 */
 	fabric = target_fabric_configfs_init(THIS_MODULE, "vhost");
-	if (!fabric) {
+	if (IS_ERR(fabric)) {
 		pr_err("target_fabric_configfs_init() failed\n");
-		return -ENOMEM;
+		return PTR_ERR(fabric);
 	}
 	/*
 	 * Setup fabric->tf_ops from our local tcm_vhost_ops
-- 
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


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux