Skip to contentSkip to conversation

scsi: Add error checking to sysfs_update_group in drivers/scsi/scsi_transport_spi.c

PATCH RESEND New Nur Hussein 1 participant 1 message Mar 2, 2023 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 scsi: Add error checking to sysfs_update_group in drivers/scsi/scsi_transport_spi.c

An instance of sysfs_update_group now checks the result and on error, logs it via pr_err().

---
 drivers/scsi/scsi_transport_spi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_spi.c +3 -2
index 2442d4d2e3f3..f905b4787a42 100644
@@ -1559,8 +1559,9 @@ static int spi_target_configure(struct transport_container *tc,
 {
 	struct kobject *kobj = &cdev->kobj;
 
-	/* force an update based on parameters read from the device */
-	sysfs_update_group(kobj, &target_attribute_group);
+	/* force an update based on parameters read from the device, log an error on failure */
+	if (sysfs_update_group(kobj, &target_attribute_group))
+		pr_err("Unable to update sysfs entries\n");
 
 	return 0;
 }
Signature · 1 line
2.34.1