Skip to content

Commit 8311ee2

Browse files
mudongliangbroonie
authored andcommitted
spi: meson-spicc: fix memory leak in meson_spicc_remove
In meson_spicc_probe, the error handling code needs to clean up master by calling spi_master_put, but the remove function does not have this function call. This will lead to memory leak of spicc->master. Reported-by: Dongliang Mu <[email protected]> Fixes: 454fa27("spi: Add Meson SPICC driver") Signed-off-by: Dongliang Mu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1d5ccab commit 8311ee2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/spi/spi-meson-spicc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ static int meson_spicc_remove(struct platform_device *pdev)
785785
clk_disable_unprepare(spicc->core);
786786
clk_disable_unprepare(spicc->pclk);
787787

788+
spi_master_put(spicc->master);
789+
788790
return 0;
789791
}
790792

0 commit comments

Comments
 (0)