mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-spi@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	Yang Yingliang <yangyingliang@huawei.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Jiawen Liu <1298662399@qq.com>
Subject: [PATCH] spi: spi-pci1xxxx: Add error handling in pci1xxxx_spi_suspend()
Date: Tue, 1 Dec 2026 15:50:29 +0100	[thread overview]
Message-ID: <83e736b7-0137-4a7f-824c-51f79817f74d@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 1 Dec 2026 15:38:28 +0100

A return value from a spi_controller_suspend() call was ignored in this
function implementation.
This issue was detected by using the Coccinelle software.

Thus add error detection and the corresponding exception handling.

Fixes: f9977bb164a26d3bec31cdaf04865accf97e4353 ("spi: mchp-pci1xxxx: switch to use modern name")
Cc: stable@vger.kernel.org
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/spi/spi-pci1xxxx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c
index e00b59ed823a..2c37ff2a8953 100644
--- a/drivers/spi/spi-pci1xxxx.c
+++ b/drivers/spi/spi-pci1xxxx.c
@@ -1061,6 +1061,7 @@ static int pci1xxxx_spi_suspend(struct device *dev)
 	struct pci1xxxx_spi *spi_ptr = dev_get_drvdata(dev);
 	struct pci1xxxx_spi_internal *spi_sub_ptr;
 	u32 reg1 = SPI_SUSPEND_CONFIG;
+	int rc;
 	u8 iter;
 
 	for (iter = 0; iter < spi_ptr->total_hw_instances; iter++) {
@@ -1071,7 +1072,10 @@ static int pci1xxxx_spi_suspend(struct device *dev)
 
 		/* Store existing config before suspend */
 		store_restore_config(spi_ptr, spi_sub_ptr, iter, 1);
-		spi_controller_suspend(spi_sub_ptr->spi_host);
+		rc = spi_controller_suspend(spi_sub_ptr->spi_host);
+		if (rc)
+			return rc;
+
 		writel(reg1, spi_ptr->reg_base +
 		       SPI_MST_EVENT_MASK_REG_OFFSET(iter));
 	}
-- 
2.56.1


                 reply	other threads:[~2026-12-01 14:51 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=83e736b7-0137-4a7f-824c-51f79817f74d@web.de \
    --to=markus.elfring@web.de \
    --cc=1298662399@qq.com \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=yangyingliang@huawei.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

all inboxes | Powered by JetHome®