mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V3] spi: spi-cadence-quadspi: Fix missing unwind goto warnings
@ 2023-09-26 13:09 Dhruva Gole
  2023-09-26 15:07 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dhruva Gole @ 2023-09-26 13:09 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi, linux-kernel, Vignesh Raghavendra, Dhruva Gole,
	kernel test robot, Dan Carpenter

The following smatch warnings 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.

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/all/5e21c351-cd08-443e-8509-aecf242a4da9@kadam.mountain/
Signed-off-by: Dhruva Gole <d-gole@ti.com>
---

*NOTE:* Please base on top of origin: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
branch: for-next

Link to v2:
https://lore.kernel.org/r/20230919074658.41666-1-d-gole@ti.com

Link to V1:
https://lore.kernel.org/all/20230915123103.2493640-1-d-gole@ti.com/

Changelog in v3:
* Rebased and removed mixing of links from commit message

Changelog in v2:
* 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: b643e6268c8f466ebb08a594b8ec8a1e2fd275a2
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-26 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-26 13:09 [PATCH V3] spi: spi-cadence-quadspi: Fix missing unwind goto warnings Dhruva Gole
2023-09-26 15:07 ` Mark Brown

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®