ibmvnic: Free RX socket buffer in case of adapter error
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Wed, 14 Feb 2018 00:23:42 +0000 (18:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:50:27 +0000 (07:50 +0200)
[ Upstream commit 4b9b0f01350500173f17e2b2e65beb4df4ef99c7 ]

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@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>
drivers/net/ethernet/ibm/ibmvnic.c

index 49094c96569721cc3a7c90f12a1bbf9442d5b4ba..897a87ae86557e5b6bd41f577f7f011de1a3c5cd 100644 (file)
@@ -994,6 +994,7 @@ restart_poll:
                        netdev_err(netdev, "rx error %x\n", 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);
                        break;
                }