Skip to contentSkip to conversation

spi: meson-spicc: Fix double-put in remove path

PATCH In review Wenshan Lan 2 participants 2 messages May 7 – May 8 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: meson-spicc: Fix double-put in remove path

From: Felix Gu <[email protected]>

[ Upstream commit 63542bb402b7013171c9f621c28b609eda4dbf1f ]

meson_spicc_probe() registers the controller with devm_spi_register_controller(), so teardown already drops the controller reference via devm cleanup.

Calling spi_controller_put() again in meson_spicc_remove() causes a double-put.

Fixes 8311ee2164c5 ("spi: meson-spicc: fix memory leak in meson_spicc_remove")

[ In v6.6, commit 68bf3288c7eb ("spi: meson-spicc: switch to use modern name") has not been applied, so the driver still uses the legacy spicc->master field and spi_master_put() API. The line to remove is spi_master_put(spicc->master) rather than spi_controller_put(spicc->host) as in the upstream patch. They are functionally identical. ]

---
 drivers/spi/spi-meson-spicc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/spi/spi-meson-spicc.c +0 -2
index 43d134f4b42b..de8cf91658fd 100644
@@ -918,8 +918,6 @@ static void meson_spicc_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(spicc->core);
 	clk_disable_unprepare(spicc->pclk);
-
-	spi_master_put(spicc->master);
 }
 
 static const struct meson_spicc_data meson_spicc_gx_data = {
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 3 lines

Subject: [PATCH 6.6.y] spi: meson-spicc: Fix double-put in remove path

commit 63542bb402b7013171c9f621c28b609eda4dbf1f upstream.

Now queued for 6.6, 6.1 and 5.15, thanks.

--
Thanks,
Sasha