Skip to contentSkip to conversation

drviers/scsi: check sysfs init return value via IS_ERR at iscsi_boot_create_kset

PATCH Applied Jeff Liu 2 participants 2 messages Jun 17, 2014

Subsystems (2)
lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 11/24 drviers/scsi: check sysfs init return value via IS_ERR at iscsi_boot_create_kset

From: Jie Liu <[email protected]>

kset_create_and_add() has been fixed to return the actual error ptr than NULL on failure, update iscsi_boot_create_kset() to check the return value via IS_ERR() accordingly.

Cc James E.J. Bottomley <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/scsi/iscsi_boot_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/iscsi_boot_sysfs.c +1 -1
index 680bf6f..821df62 100644
@@ -443,7 +443,7 @@ struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name)
 		return NULL;
 
 	boot_kset->kset = kset_create_and_add(set_name, NULL, firmware_kobj);
-	if (!boot_kset->kset) {
+	if (IS_ERR(boot_kset->kset)) {
 		kfree(boot_kset);
 		return NULL;
 	}
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 18 lines · Jeff Liu

From: Jie Liu <[email protected]>

kset_create_and_add() has been fixed to return the actual error ptr than NULL on failure, update iscsi_boot_create_kset() to check the return value via IS_ERR() accordingly.

Cc James E.J. Bottomley <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/scsi/iscsi_boot_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/iscsi_boot_sysfs.c +0 -0
index 680bf6f..821df62 100644

drivers/scsi/iscsi_boot_sysfs.c struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name) · line 449

Quoted 8 lines
drivers/scsi/iscsi_boot_sysfs.c +1 -1
@@ -443,7 +443,7 @@ struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name)
 		return NULL;
 
 	boot_kset->kset = kset_create_and_add(set_name, NULL, firmware_kobj);
-	if (!boot_kset->kset) {
+	if (IS_ERR(boot_kset->kset)) {
 		kfree(boot_kset);
 		return NULL;
 	}

James, please do not take this patch.

thanks,

greg k-h