Skip to contentSkip to conversation

spi: sunplus-sp7021: Unlock on error path

PATCH New Dan Carpenter 1 participant 1 message Jan 28, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: sunplus-sp7021: Unlock on error path

Drop the "pspim->buf_lock" before returning on this error path.

Fixes f62ca4e2a863 ("spi: Add spi driver for Sunplus SP7021")
---
 drivers/spi/spi-sunplus-sp7021.c | 1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-sunplus-sp7021.c +1 -0
index 627b9c3024e9..cbbb1664017e 100644
@@ -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;
 		}
 
Signature · 1 line
2.20.1