aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhruva Gole <[email protected]>2023-09-19 13:16:59 +0530
committerMark Brown <[email protected]>2023-09-26 14:49:24 +0200
commit86401132d7bbb550d80df0959ad9fa356ebc168d (patch)
treee1ff936f5361dbcf3689c39258882a34a3b9639b
parent2d9f4877988f64f0f336983de65c365b6a7debfb (diff)
spi: spi-cadence-quadspi: Fix missing unwind goto warnings
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/[email protected]/ Fixes: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Dhruva Gole <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/spi-cadence-quadspi.c7
1 files 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);