spi: fix finalize message on error return
authorDavid Lechner <dlechner@baylibre.com>
Thu, 25 Jan 2024 20:53:09 +0000 (14:53 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:13 +0000 (16:19 -0800)
commit0232a19a0e215e1630ea821fd83fcf8d2de39b21
tree3f1cd68e5c7e9bcda52e2d6bfd368831b09b3e6f
parentd69a84cbbc30c7c386ad620b7704ce423d7fca03
spi: fix finalize message on error return

[ Upstream commit 8c2ae772fe08e33f3d7a83849e85539320701abd ]

In __spi_pump_transfer_message(), the message was not finalized in the
first error return as it is in the other error return paths. Not
finalizing the message could cause anything waiting on the message to
complete to hang forever.

This adds the missing call to spi_finalize_current_message().

Fixes: ae7d2346dc89 ("spi: Don't use the message queue if possible in spi_sync")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://msgid.link/r/20240125205312.3458541-2-dlechner@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi.c