[Bionic PATCH 16/19] ibmvnic: Free RX socket buffer in case of adapter error

Thadeu Lima de Souza Cascardo cascardo at canonical.com
Tue Feb 27 15:12:12 UTC 2018


From: Thomas Falcon <tlfalcon at linux.vnet.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1748517

If a RX buffer is returned to the client driver with an error, free the
corresponding socket buffer before continuing.

Signed-off-by: Thomas Falcon <tlfalcon at linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 4b9b0f01350500173f17e2b2e65beb4df4ef99c7)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index a14e2a36f319..b3990132cad6 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1869,6 +1869,7 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
 				   be16_to_cpu(next->rx_comp.rc));
 			/* free the entry */
 			next->rx_comp.first = 0;
+			dev_kfree_skb_any(rx_buff->skb);
 			remove_buff_from_pool(adapter, rx_buff);
 			continue;
 		}
-- 
2.15.1





More information about the kernel-team mailing list