diff options
author | Thomas Falcon <tlfalcon@linux.vnet.ibm.com> | 2018-02-20 05:12:57 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-30 08:51:59 +0300 |
commit | 2e9f41ace36b52039ce195a9109cb221a8ad93d2 (patch) | |
tree | 2dd5731b125a525f29f734afad67dd19c74ea374 /drivers | |
parent | 775cc792bb0879d65f7fa446ce4bd82096447e34 (diff) | |
download | linux-2e9f41ace36b52039ce195a9109cb221a8ad93d2.tar.xz |
ibmvnic: Check for NULL skb's in NAPI poll routine
[ Upstream commit abe27a885d9e6575e663a16176dabc58ce9d7188 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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 6db5fc292030..6ac4dd5bb30a 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1668,6 +1668,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); |