Commit f99165e
spi: imx: fix use-after-free on unbind
commit 1c78c20 upstream.
The SPI subsystem frees the controller and any subsystem allocated
driver data as part of deregistration (unless the allocation is device
managed).
Take another reference before deregistering the controller so that the
driver data is not freed until the driver is done with it.
Fixes: 307c897 ("spi: spi-imx: replace struct spi_imx_data::bitbang by pointer to struct spi_controller")
Cc: stable@vger.kernel.org # 5.19
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260324082326.901043-2-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 8c43ed0 commit f99165e
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1898 | 1898 | | |
1899 | 1899 | | |
1900 | 1900 | | |
| 1901 | + | |
| 1902 | + | |
1901 | 1903 | | |
1902 | 1904 | | |
1903 | 1905 | | |
| |||
1911 | 1913 | | |
1912 | 1914 | | |
1913 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
1914 | 1918 | | |
1915 | 1919 | | |
1916 | 1920 | | |
| |||
0 commit comments