diff options
author | Thomas Falcon <tlfalcon@linux.vnet.ibm.com> | 2018-02-19 20:12:57 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-20 14:31:11 -0500 |
commit | abe27a885d9e6575e663a16176dabc58ce9d7188 (patch) | |
tree | 2da2d624cb62195bb7530579a7b9f7b1fd679d8b | |
parent | 79c0ef3e85c015b0921a8fd5dd539d1480e9cd6c (diff) |
ibmvnic: Check for NULL skb's in NAPI poll routine
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@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 996f47568f9e..1495cb99f924 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1901,6 +1901,11 @@ restart_poll: dev_kfree_skb_any(rx_buff->skb); remove_buff_from_pool(adapter, rx_buff); continue; + } 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); |