Commit 60433572 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown

spi: spi-zynqmp-gqspi: Fix missing unlock on error in zynqmp_qspi_exec_op()

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

Fixes: a0f65be6 ("spi: spi-zynqmp-gqspi: add mutex locking for exec_op")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210412160025.194171-1-weiyongjun1@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 828b4809
......@@ -965,8 +965,10 @@ static int zynqmp_qspi_exec_op(struct spi_mem *mem,
if (op->cmd.opcode) {
tmpbuf = kzalloc(op->cmd.nbytes, GFP_KERNEL | GFP_DMA);
if (!tmpbuf)
if (!tmpbuf) {
mutex_unlock(&xqspi->op_lock);
return -ENOMEM;
}
tmpbuf[0] = op->cmd.opcode;
reinit_completion(&xqspi->data_completion);
xqspi->txbuf = tmpbuf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment