Skip to contentSkip to conversation

hid: intel-ish-hid: fix wrong error handling in ishtp_cl_alloc_tx_ring()

PATCH Applied Zhang Lixu 2 participants 2 messages Oct 16, 2019

Subsystems (2)
lore
Share & tools
lore

Zhang Lixu

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/intel-ish-hid/ishtp/client-buffers.c +1 -1
index 1b0a0cc605e7..513d7a4a1b8a 100644
@@ -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;
 }
 
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 13 lines · Zhang Lixu

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

---
 drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/intel-ish-hid/ishtp/client-buffers.c +0 -0
index 1b0a0cc605e7..513d7a4a1b8a 100644

drivers/hid/intel-ish-hid/ishtp/client-buffers.c int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl) · line 87

Quoted 5 lines
drivers/hid/intel-ish-hid/ishtp/client-buffers.c +1 -1
@@ -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.

Signature · 2 lines
Jiri Kosina
SUSE Labs