[PATCH v2 0/5] spi: imx: fix use-after-free on unbind

From: Johan Hovold

Date: Tue Mar 24 2026 - 04:32:36 EST


The SPI subsystem frees the controller and any subsystem allocated
driver data as part of deregistration (unless the allocation is device
managed).

This series fixes the IMX driver that got this wrong and then converts
it to use device managed allocation.

Included are also a (preparatory) deregistration fix for the rockchip
driver and related cleanups for the tegre20-slink and rockchip drivers
that both take a controller reference during unbind.

Johan


Changes in v2
- add stable tag to rockchip fix
- move rockchip fix before the cleanups


Johan Hovold (5):
spi: imx: fix use-after-free on unbind
spi: rockchip: fix controller deregistration
spi: imx: switch to managed controller allocation
spi: tegra20-slink: switch to managed controller allocation
spi: rockchip: switch to managed controller allocation

drivers/spi/spi-imx.c | 41 +++++++++++----------------------
drivers/spi/spi-rockchip.c | 40 +++++++++++++-------------------
drivers/spi/spi-tegra20-slink.c | 26 ++++++++-------------
3 files changed, 40 insertions(+), 67 deletions(-)

--
2.52.0