spi: imx: Don't skip cleanup in remove's error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 6 Mar 2023 06:57:32 +0000 (07:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:27 +0000 (23:03 +0900)
commit6d16305a1535873e0a8a8ae92ea2d9106ec2d7df
tree92fd8d96520584d8564872bd1d92101554311c03
parentf6974fb20499e3b6522daa7aec822aac11dfcf42
spi: imx: Don't skip cleanup in remove's error path

[ Upstream commit 11951c9e3f364d7ae3b568a0e52c8335d43066b5 ]

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: d593574aff0a ("spi: imx: do not access registers while clocks disabled")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230306065733.2170662-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-imx.c