From: Sucheta Chakraborty Date: Thu, 14 Jul 2011 03:16:53 +0000 (+0000) Subject: qlcnic: fix race in skb->len access. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f127f4727f3f60359570b6daa136ac1156e38fbf;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Amit Kumar Salecha Signed-off-by: David S. Miller --- diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 916570db3aa4..006a693d49a7 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: