diff mbox series

[-next] spi: Fix missing unlock on error in sp7021_spi_master_transfer_one()

Message ID 20220127115815.3148950-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 20dc69ca1023b7e4c4af3c3495aa5a91e1a9be39
Headers show
Series [-next] spi: Fix missing unlock on error in sp7021_spi_master_transfer_one() | expand

Commit Message

Yang Yingliang Jan. 27, 2022, 11:58 a.m. UTC
Add the missing unlock before return from sp7021_spi_master_transfer_one()
in the error handling case.

Fixes: f62ca4e2a863 ("spi: Add spi driver for Sunplus SP7021")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/spi/spi-sunplus-sp7021.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mark Brown Jan. 28, 2022, 3:59 p.m. UTC | #1
On Thu, 27 Jan 2022 19:58:15 +0800, Yang Yingliang wrote:
> Add the missing unlock before return from sp7021_spi_master_transfer_one()
> in the error handling case.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: Fix missing unlock on error in sp7021_spi_master_transfer_one()
      commit: 20dc69ca1023b7e4c4af3c3495aa5a91e1a9be39

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus-sp7021.c
index 627b9c3024e9..cbbb1664017e 100644
--- a/drivers/spi/spi-sunplus-sp7021.c
+++ b/drivers/spi/spi-sunplus-sp7021.c
@@ -351,6 +351,7 @@  static int sp7021_spi_master_transfer_one(struct spi_controller *ctlr, struct sp
 
 		if (!wait_for_completion_interruptible_timeout(&pspim->isr_done, timeout)) {
 			dev_err(&spi->dev, "wait_for_completion err\n");
+			mutex_unlock(&pspim->buf_lock);
 			return -ETIMEDOUT;
 		}