net: use consume_skb() in place of kfree_skb()

Remove some dropwatch/drop_monitor false positives.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet
2012-06-04 01:17:19 +00:00
committed by David S. Miller
parent 4aea39c11c
commit 5d0ba55b64
7 changed files with 14 additions and 12 deletions

View File

@@ -231,9 +231,11 @@ static netdev_tx_t lec_start_xmit(struct sk_buff *skb,
if (skb_headroom(skb) < 2) {
pr_debug("reallocating skb\n");
skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN);
kfree_skb(skb);
if (skb2 == NULL)
if (unlikely(!skb2)) {
kfree_skb(skb);
return NETDEV_TX_OK;
}
consume_skb(skb);
skb = skb2;
}
skb_push(skb, 2);