[Bionic PATCH 18/19] ibmvnic: Check for NULL skb's in NAPI poll routine

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

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

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

After introduction of commit d0869c0071e4, there were some instances of
RX queue entries from a previous session (before the device was closed
and reopened) returned to the NAPI polling routine. Since the corresponding
socket buffers were freed, this resulted in a panic on reopen. Include
a check for a NULL skb here to avoid this.

Fixes: d0869c0071e4 ("ibmvnic: Clean RX pool buffers during device close")
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 abe27a885d9e6575e663a16176dabc58ce9d7188)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
 drivers/net/ethernet/ibm/ibmvnic.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index bc3130f37732..fb6993da6eeb 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1901,6 +1901,11 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget)
 			remove_buff_from_pool(adapter, rx_buff);
+		} else if (!rx_buff->skb) {
+			/* free the entry */
+			next->rx_comp.first = 0;
+			remove_buff_from_pool(adapter, rx_buff);
+			continue;
 		length = be32_to_cpu(next->rx_comp.len);

More information about the kernel-team mailing list