]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: davinci: Fix use-after-free on unbind
authorLukas Wunner <lukas@wunner.de>
Mon, 7 Dec 2020 08:17:01 +0000 (09:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:47:09 +0000 (13:47 +0100)
commit631aae36f0a7fe244a97aca0a466bb7f6db57d5e
treee74720176cc3d80eacd56829cbaffbe8b5efb230
parent483c8fa00e22d4b3d46131bb5886d981caa2b0c8
spi: davinci: Fix use-after-free on unbind

commit 373afef350a93519b4b8d636b0895da8650b714b upstream.

davinci_spi_remove() accesses the driver's private data after it's been
freed with spi_master_put().

Fix by moving the spi_master_put() to the end of the function.

Fixes: fe5fd2540947 ("spi: davinci: Use dma_request_chan() for requesting DMA channel")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: <stable@vger.kernel.org> # v4.7+
Link: https://lore.kernel.org/r/412f7eb1cf8990e0a3a2153f4c577298deab623e.1607286887.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-davinci.c