niu: don't count tx error twice in case of headroom realloc fails

commit 42288830494cd51873ca745a7a229023df061226 upstream.

Fixes: a3138df9 ("[NIU]: Add Sun Neptune ethernet driver.")
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
Jiri Pirko 2015-07-23 12:20:37 +02:00 committed by Zefan Li
parent cdaad7c1e1
commit 50f46c9771
1 changed files with 1 additions and 3 deletions

View File

@ -6659,10 +6659,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
struct sk_buff *skb_new;
skb_new = skb_realloc_headroom(skb, len);
if (!skb_new) {
rp->tx_errors++;
if (!skb_new)
goto out_drop;
}
kfree_skb(skb);
skb = skb_new;
} else