Skip to content

Commit 8640113

Browse files
DhruvaG2000broonie
authored andcommitted
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/5e21c351-cd08-443e-8509-aecf242a4da9@kadam.mountain/ Fixes: 0578a6d ("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: https://lore.kernel.org/r/20230919074658.41666-1-d-gole@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2d9f487 commit 8640113

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/spi/spi-cadence-quadspi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,8 +1878,11 @@ static int cqspi_probe(struct platform_device *pdev)
18781878
}
18791879

18801880
ret = devm_pm_runtime_enable(dev);
1881-
if (ret)
1882-
return ret;
1881+
if (ret) {
1882+
if (cqspi->rx_chan)
1883+
dma_release_channel(cqspi->rx_chan);
1884+
goto probe_setup_failed;
1885+
}
18831886

18841887
pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
18851888
pm_runtime_use_autosuspend(dev);

0 commit comments

Comments
 (0)