Skip to content
Unverified Commit 79c6246a authored by Alain Volmat's avatar Alain Volmat Committed by Mark Brown
Browse files

spi: stm32: Fix use-after-free on unbind



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 accessible until the driver has unbound.

Fixes: 8d559a64 ("spi: stm32: drop devres version of spi_register_master")

Reported-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarAlain Volmat <alain.volmat@foss.st.com>
Link: https://lore.kernel.org/r/1616052290-10887-1-git-send-email-alain.volmat@foss.st.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 92bad4a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment