Re: [PATCH] spi: stm32: Fix use-after-free on unbind

2021-03-19 Thread Mark Brown
On Thu, 18 Mar 2021 08:24:50 +0100, Alain Volmat wrote: > stm32_spi_remove() accesses the driver's private data after calling > spi_unregister_master() even though that function releases the last > reference on the spi_master and thereby frees the private data. > > Fix by switching over to the new

[PATCH] spi: stm32: Fix use-after-free on unbind

2021-03-18 Thread Alain Volmat
stm32_spi_remove() accesses the driver's private data after calling spi_unregister_master() even though that function releases the last reference on the spi_master and thereby frees the private data. Fix by switching over to the new devm_spi_alloc_master() helper which keeps the private data acces