[PATCH] spi: meson-spicc: Fix double-put in remove path
Johan Hovold
johan at kernel.org
Mon Mar 23 03:55:32 PDT 2026
On Sun, Mar 22, 2026 at 09:29:56PM +0800, Felix Gu wrote:
> 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.
Indeed it does:
Reviewed-by: Johan Hovold <johan at kernel.org>
> Fixes: 8311ee2164c5 ("spi: meson-spicc: fix memory leak in meson_spicc_remove")
While only root can trigger this it should probably still go stable:
Cc: stable at vger.kernel.org
> Signed-off-by: Felix Gu <ustc.gu at gmail.com>
How did you find this one? Are you using some kind of static analysis
tool or LLM?
Johan
More information about the linux-amlogic
mailing list