spi: Fix missing unlock on error in sp7021_spi_master_transfer_one()

Add the missing unlock before return from sp7021_spi_master_transfer_one()
in the error handling case.

Fixes: f62ca4e2a8 ("spi: Add spi driver for Sunplus SP7021")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220127115815.3148950-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Yang Yingliang 2022-01-27 19:58:15 +08:00 committed by Mark Brown
parent 474fc2e639
commit 20dc69ca10
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}