diff options
author | Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> | 2011-07-14 03:16:53 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-14 08:49:44 -0700 |
commit | f127f4727f3f60359570b6daa136ac1156e38fbf (patch) | |
tree | 068e73d445ce8b5fc798701a8e48b2d3b3973f5d /drivers/net/qlcnic | |
parent | e5dcf6dcde26ffdbd237dda4956bc6d7115dfae6 (diff) |
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: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 916570db3aa..006a693d49a 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -2290,11 +2290,11 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) if (adapter->mac_learn) qlcnic_send_filter(adapter, tx_ring, first_desc, skb); - qlcnic_update_cmd_producer(adapter, tx_ring); - adapter->stats.txbytes += skb->len; adapter->stats.xmitcalled++; + qlcnic_update_cmd_producer(adapter, tx_ring); + return NETDEV_TX_OK; unwind_buff: |