mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
spi: spi-zynqmp-gqspi: Fix missing unlock on error in zynqmp_qspi_exec_op()
[ Upstream commit6043357263] Add the missing unlock before return from function zynqmp_qspi_exec_op() in the error handling case. Fixes:a0f65be6e8("spi: spi-zynqmp-gqspi: add mutex locking for exec_op") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Link: https://lore.kernel.org/r/20210412160025.194171-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
58ee5a0de1
commit
73585b2714
|
|
@ -965,8 +965,10 @@ static int zynqmp_qspi_exec_op(struct spi_mem *mem,
|
||||||
|
|
||||||
if (op->cmd.opcode) {
|
if (op->cmd.opcode) {
|
||||||
tmpbuf = kzalloc(op->cmd.nbytes, GFP_KERNEL | GFP_DMA);
|
tmpbuf = kzalloc(op->cmd.nbytes, GFP_KERNEL | GFP_DMA);
|
||||||
if (!tmpbuf)
|
if (!tmpbuf) {
|
||||||
|
mutex_unlock(&xqspi->op_lock);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
tmpbuf[0] = op->cmd.opcode;
|
tmpbuf[0] = op->cmd.opcode;
|
||||||
reinit_completion(&xqspi->data_completion);
|
reinit_completion(&xqspi->data_completion);
|
||||||
xqspi->txbuf = tmpbuf;
|
xqspi->txbuf = tmpbuf;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user