diff options
author | David S. Miller <davem@davemloft.net> | 2017-04-22 05:23:53 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-22 05:23:53 +0200 |
commit | fb796707d7a6c9b24fdf80b9b4f24fa5ffcf0ec5 (patch) | |
tree | b8c12edf3f510170cece6e9cf5337094af3095f2 /drivers/net/usb/kaweth.c | |
parent | net: Remove NET_CORE_BUDGET_USECS from sysctl binary interface. (diff) | |
parent | Merge tag 'nfsd-4.11-2' of git://linux-nfs.org/~bfields/linux (diff) | |
download | linux-fb796707d7a6c9b24fdf80b9b4f24fa5ffcf0ec5.tar.xz linux-fb796707d7a6c9b24fdf80b9b4f24fa5ffcf0ec5.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Both conflict were simple overlapping changes.
In the kaweth case, Eric Dumazet's skb_cow() bug fix overlapped the
conversion of the driver in net-next to use in-netdev stats.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/kaweth.c')
-rw-r--r-- | drivers/net/usb/kaweth.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 3d8ea18df696..37fb621fde86 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c @@ -801,18 +801,12 @@ static netdev_tx_t kaweth_start_xmit(struct sk_buff *skb, } /* We now decide whether we can put our special header into the sk_buff */ - if (skb_cloned(skb) || skb_headroom(skb) < 2) { - /* no such luck - we make our own */ - struct sk_buff *copied_skb; - copied_skb = skb_copy_expand(skb, 2, 0, GFP_ATOMIC); - dev_kfree_skb_irq(skb); - skb = copied_skb; - if (!copied_skb) { - net->stats.tx_errors++; - netif_start_queue(net); - spin_unlock_irq(&kaweth->device_lock); - return NETDEV_TX_OK; - } + if (skb_cow_head(skb, 2)) { + net->stats.tx_errors++; + netif_start_queue(net); + spin_unlock_irq(&kaweth->device_lock); + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; } private_header = (__le16 *)__skb_push(skb, 2); |