Skip to content

Commit 73cd1f9

Browse files
outman119broonie
authored andcommitted
spi: stm32-ospi: Fix resource leak in remove() callback
The remove() callback returned early if pm_runtime_resume_and_get() failed, skipping the cleanup of spi controller and other resources. Remove the early return so cleanup completes regardless of PM resume result. Fixes: 79b8a70 ("spi: stm32: Add OSPI driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://patch.msgid.link/20260329-ospi-v1-1-cc8cf1c82c4a@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7aaa804 commit 73cd1f9

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/spi/spi-stm32-ospi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,11 +989,8 @@ static int stm32_ospi_probe(struct platform_device *pdev)
989989
static void stm32_ospi_remove(struct platform_device *pdev)
990990
{
991991
struct stm32_ospi *ospi = platform_get_drvdata(pdev);
992-
int ret;
993992

994-
ret = pm_runtime_resume_and_get(ospi->dev);
995-
if (ret < 0)
996-
return;
993+
pm_runtime_resume_and_get(ospi->dev);
997994

998995
spi_unregister_controller(ospi->ctrl);
999996
/* Disable ospi */

0 commit comments

Comments
 (0)