Commit f127f472 authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller

qlcnic: fix race in skb->len access.

As soon as skb is given to hardware, TX completion can free skb under us.
Therefore, we should update dev stats before kicking the device.
Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e5dcf6dc
...@@ -2290,11 +2290,11 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -2290,11 +2290,11 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
if (adapter->mac_learn) if (adapter->mac_learn)
qlcnic_send_filter(adapter, tx_ring, first_desc, skb); qlcnic_send_filter(adapter, tx_ring, first_desc, skb);
qlcnic_update_cmd_producer(adapter, tx_ring);
adapter->stats.txbytes += skb->len; adapter->stats.txbytes += skb->len;
adapter->stats.xmitcalled++; adapter->stats.xmitcalled++;
qlcnic_update_cmd_producer(adapter, tx_ring);
return NETDEV_TX_OK; return NETDEV_TX_OK;
unwind_buff: unwind_buff:
......
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