Re: [PATCH] spi: meson-spicc: Fix double-put in remove path

From: Johan Hovold

Date: Mon Mar 23 2026 - 07:01:03 EST


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@xxxxxxxxxx>

> 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@xxxxxxxxxxxxxxx

> Signed-off-by: Felix Gu <ustc.gu@xxxxxxxxx>

How did you find this one? Are you using some kind of static analysis
tool or LLM?

Johan