From: Dhruva Gole <d-gole@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
Dhruva Gole <d-gole@ti.com>, kernel test robot <lkp@intel.com>,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
Date: Tue, 19 Sep 2023 13:16:59 +0530 [thread overview]
Message-ID: <20230919074658.41666-1-d-gole@ti.com> (raw)
The following smatch warnings [0] were recently introduced:
drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing
unwind goto?
Fix these warnings by releasing dma channel and adding a goto fail probe.
[0] https://lore.kernel.org/all/5e21c351-cd08-443e-8509-aecf242a4da9@kadam.mountain/
Fixes: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202309140543.03dMbMM5-lkp@intel.com/
Signed-off-by: Dhruva Gole <d-gole@ti.com>
---
Link to V1:
https://lore.kernel.org/all/20230915123103.2493640-1-d-gole@ti.com/
Changelog:
* added dma_release_channel
* added a fixes tag.
drivers/spi/spi-cadence-quadspi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 4828da4587c5..3d7bf62da11c 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1878,8 +1878,11 @@ static int cqspi_probe(struct platform_device *pdev)
}
ret = devm_pm_runtime_enable(dev);
- if (ret)
- return ret;
+ if (ret) {
+ if (cqspi->rx_chan)
+ dma_release_channel(cqspi->rx_chan);
+ goto probe_setup_failed;
+ }
pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
pm_runtime_use_autosuspend(dev);
base-commit: 21f252cd29f08892d48739fd7513ad79c1cff96a
--
2.34.1
next reply other threads:[~2023-09-19 7:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 7:46 Dhruva Gole [this message]
2023-09-21 12:03 ` [PATCH V2] spi: spi-cadence-quadspi: Fix missing unwind goto warnings Dan Carpenter
2023-09-26 11:21 ` Mark Brown
2023-09-26 11:34 ` Dhruva Gole
2023-09-26 11:40 ` Dhruva Gole
2023-09-26 11:58 ` Mark Brown
2023-09-26 12:19 ` Dhruva Gole
2023-09-26 12:48 ` Mark Brown
2023-09-26 13:13 ` Dhruva Gole
2023-09-26 15:07 ` Mark Brown
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=20230919074658.41666-1-d-gole@ti.com \
--to=d-gole@ti.com \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=vigneshr@ti.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