From: Thomas Falcon Date: Fri, 26 May 2017 14:30:31 +0000 (-0400) Subject: ibmvnic: Fix cleanup of SKB's on driver close X-Git-Tag: v5.15~10982^2~356^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10f7621588b86d181a167c1535d0754eb5a58ba8;p=platform%2Fkernel%2Flinux-starfive.git ibmvnic: Fix cleanup of SKB's on driver close A race condition occurs when closing the driver. Free'ing of skb's can race between the close routine and ibmvnic_tx_interrupt. To fix this we move the claenup of tx pools during close to after the sub-CRQ interrupts are disabled. Signed-off-by: Thomas Falcon Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 465a8fa..0f705e6 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -804,7 +804,6 @@ static int __ibmvnic_close(struct net_device *netdev) adapter->state = VNIC_CLOSING; netif_tx_stop_all_queues(netdev); ibmvnic_napi_disable(adapter); - clean_tx_pools(adapter); if (adapter->tx_scrq) { for (i = 0; i < adapter->req_tx_queues; i++) @@ -833,6 +832,7 @@ static int __ibmvnic_close(struct net_device *netdev) } } + clean_tx_pools(adapter); adapter->state = VNIC_CLOSED; return rc; }