Skip to contentSkip to conversation

spi: spi-cadence-quadspi: Fix missing unwind goto warnings

PATCH In review Dhruva Gole 2 participants 2 messages Sep 26, 2023 SPI

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 spi: spi-cadence-quadspi: Fix missing unwind goto warnings

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")

---

*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/[email protected]

Link to V1:
https://lore.kernel.org/all/[email protected]/

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(-)
drivers/spi/spi-cadence-quadspi.c +5 -2
index 4828da4587c5..3d7bf62da11c 100644
@@ -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

Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 8 lines · Dhruva Gole

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spi-cadence-quadspi: Fix missing unwind goto warnings

      commit: 86401132d7bbb550d80df0959ad9fa356ebc168d

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark