public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nur Hussein <hussein@unixcat.org>
To: jejb@linux.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Nur Hussein <hussein@unixcat.org>
Subject: [PATCH RESEND] scsi: Add error checking to sysfs_update_group in drivers/scsi/scsi_transport_spi.c
Date: Fri,  3 Mar 2023 02:37:35 +0800	[thread overview]
Message-ID: <20230302183735.1281237-1-hussein@unixcat.org> (raw)

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

Signed-off-by: Nur Hussein <hussein@unixcat.org>
---
 drivers/scsi/scsi_transport_spi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 2442d4d2e3f3..f905b4787a42 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -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;
 }
-- 
2.34.1


                 reply	other threads:[~2023-03-02 18:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230302183735.1281237-1-hussein@unixcat.org \
    --to=hussein@unixcat.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox