2019-10-16 07:42:50

by Zhang, Lixu

[permalink] [raw]
Subject: [PATCH] hid: intel-ish-hid: fix wrong error handling in ishtp_cl_alloc_tx_ring()

When allocating tx ring buffers failed, should free tx buffers, not rx buffers.

Signed-off-by: Zhang Lixu <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
---
drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
index 1b0a0cc605e7..513d7a4a1b8a 100644
--- a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
+++ b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
@@ -84,7 +84,7 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl)
return 0;
out:
dev_err(&cl->device->dev, "error in allocating Tx pool\n");
- ishtp_cl_free_rx_ring(cl);
+ ishtp_cl_free_tx_ring(cl);
return -ENOMEM;
}

--
2.17.1


2019-10-16 11:54:41

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] hid: intel-ish-hid: fix wrong error handling in ishtp_cl_alloc_tx_ring()

On Wed, 16 Oct 2019, Zhang Lixu wrote:

> When allocating tx ring buffers failed, should free tx buffers, not rx buffers.
>
> Signed-off-by: Zhang Lixu <[email protected]>
> Acked-by: Srinivas Pandruvada <[email protected]>
> ---
> drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
> index 1b0a0cc605e7..513d7a4a1b8a 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c
> @@ -84,7 +84,7 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl)
> return 0;
> out:
> dev_err(&cl->device->dev, "error in allocating Tx pool\n");
> - ishtp_cl_free_rx_ring(cl);
> + ishtp_cl_free_tx_ring(cl);

Applied to for-5.4/upstream-fixes, thanks.

--
Jiri Kosina
SUSE Labs