]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: meson-spicc: Fix double-put in remove path
authorFelix Gu <ustc.gu@gmail.com>
Sun, 22 Mar 2026 13:29:56 +0000 (21:29 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Mar 2026 18:32:05 +0000 (18:32 +0000)
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")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260322-rockchip-v1-1-fac3f0c6dad8@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-meson-spicc.c

index a7001b9e36e6ffa945a07981db654cffdf42ba67..57768da3205d255222ba02cd0b9514cec7e66784 100644 (file)
@@ -1101,8 +1101,6 @@ static void meson_spicc_remove(struct platform_device *pdev)
 
        /* Disable SPI */
        writel(0, spicc->base + SPICC_CONREG);
-
-       spi_controller_put(spicc->host);
 }
 
 static const struct meson_spicc_data meson_spicc_gx_data = {