On Thu, Jun 24, 2021 at 5:53 AM quanyang.wang
<[email protected]> wrote:
>
> From: Wei Yongjun <[email protected]>
>
> Add the missing unlock before return from function zynqmp_qspi_exec_op()
> in the error handling case.
>
> Fixes: a0f65be6e880 ("spi: spi-zynqmp-gqspi: add mutex locking for exec_op")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Wei Yongjun <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]
> Signed-off-by: Mark Brown <[email protected]>
> ---
> Hi Michal & Amit,
>
Hi Quanyang,
I just wanted to confirm that this doesn't apply to any of the
xlnx-soc branches in linux-yocto or linux-yocto-dev (I checked!)
If you do need this applied to any of those kernels, let me know what I missed!
Bruce
> This patch is picked from mainline to fix the error reported by lkp:
> [xlnx:xlnx_rebase_v5.10 65/1749] drivers/spi/spi-zynqmp-gqspi.c:1087
> zynqmp_qspi_exec_op() warn: inconsistent returns '&xqspi->op_lock'.
>
> Thanks,
> Quanyang
> ---
> drivers/spi/spi-zynqmp-gqspi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
> index 036d8ae41c06..408e348382c5 100644
> --- a/drivers/spi/spi-zynqmp-gqspi.c
> +++ b/drivers/spi/spi-zynqmp-gqspi.c
> @@ -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;
> --
> 2.25.1
>
>
>
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10005):
https://lists.yoctoproject.org/g/linux-yocto/message/10005
Mute This Topic: https://lists.yoctoproject.org/mt/83757287/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-