Unverified Commit 5a570c8d authored by Felix Gu's avatar Felix Gu Committed by Mark Brown
Browse files

spi: stm32-ospi: Fix reset control leak on probe error



When spi_register_controller() fails after reset_control_acquire()
succeeds, the reset control is never released. This causes a resource
leak in the error path.

Add the missing reset_control_release() call in the error path.

Fixes: cf2c3ece ("spi: stm32-ospi: Make usage of reset_control_acquire/release() API")
Signed-off-by: default avatarFelix Gu <ustc.gu@gmail.com>
Reviewed-by: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
Link: https://patch.msgid.link/20260329-stm32-ospi-v1-1-142122466412@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 73cd1f97
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -965,13 +965,15 @@ static int stm32_ospi_probe(struct platform_device *pdev)
	if (ret) {
		/* Disable ospi */
		writel_relaxed(0, ospi->regs_base + OSPI_CR);
		goto err_pm_resume;
		goto err_reset_control;
	}

	pm_runtime_put_autosuspend(ospi->dev);

	return 0;

err_reset_control:
	reset_control_release(ospi->rstc);
err_pm_resume:
	pm_runtime_put_sync_suspend(ospi->dev);