spi: qup: Don't skip cleanup in remove's error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 30 Mar 2023 21:03:40 +0000 (23:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:28 +0000 (23:03 +0900)
commit2d0f63077f481f11a07f20eab1c1f4367dfaef32
tree864586adfbfa8cc6b7d7cd03fe523516be737288
parent5e678bfebb527defa3e8400b0e700013838bd3e2
spi: qup: Don't skip cleanup in remove's error path

[ Upstream commit 61f49171a43ab1f80c73c5c88c508770c461e0f2 ]

Returning early in a platform driver's remove callback is wrong. In this
case the dma resources are not released in the error path. this is never
retried later and so this is a permanent leak. To fix this, only skip
hardware disabling if waking the device fails.

Fixes: 64ff247a978f ("spi: Add Qualcomm QUP SPI controller support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230330210341.2459548-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-qup.c