Commit 93fcf83e authored by Noam Camus's avatar Noam Camus Committed by David S. Miller

NET: nps_enet: TX done race condition

We need to set tx_skb pointer before send frame.
If we receive interrupt before we set pointer we will try
to free SKB with wrong pointer.
Now we are sure that SKB pointer will never be NULL during
handling TX done and check is removed.
Signed-off-by: default avatarNoam Camus <noamc@ezchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0dd20f3c
...@@ -158,11 +158,7 @@ static void nps_enet_tx_handler(struct net_device *ndev) ...@@ -158,11 +158,7 @@ static void nps_enet_tx_handler(struct net_device *ndev)
ndev->stats.tx_bytes += tx_ctrl.nt; ndev->stats.tx_bytes += tx_ctrl.nt;
} }
if (priv->tx_skb) { dev_kfree_skb(priv->tx_skb);
dev_kfree_skb(priv->tx_skb);
priv->tx_skb = NULL;
}
priv->tx_packet_sent = false; priv->tx_packet_sent = false;
if (netif_queue_stopped(ndev)) if (netif_queue_stopped(ndev))
...@@ -528,10 +524,10 @@ static netdev_tx_t nps_enet_start_xmit(struct sk_buff *skb, ...@@ -528,10 +524,10 @@ static netdev_tx_t nps_enet_start_xmit(struct sk_buff *skb,
/* This driver handles one frame at a time */ /* This driver handles one frame at a time */
netif_stop_queue(ndev); netif_stop_queue(ndev);
nps_enet_send_frame(ndev, skb);
priv->tx_skb = skb; priv->tx_skb = skb;
nps_enet_send_frame(ndev, skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment