Skip to content

Commit

Permalink
jme: remove open-coded skb_cow_head.
Browse files Browse the repository at this point in the history
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
françois romieu authored and David S. Miller committed Mar 29, 2014
1 parent d8e4435 commit ba4e6d1
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions drivers/net/ethernet/jme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,19 +2053,6 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)

}

static int
jme_expand_header(struct jme_adapter *jme, struct sk_buff *skb)
{
if (unlikely(skb_shinfo(skb)->gso_size &&
skb_header_cloned(skb) &&
pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) {
dev_kfree_skb_any(skb);
return -1;
}

return 0;
}

static int
jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags)
{
Expand Down Expand Up @@ -2225,7 +2212,8 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev)
struct jme_adapter *jme = netdev_priv(netdev);
int idx;

if (unlikely(jme_expand_header(jme, skb))) {
if (unlikely(skb_is_gso(skb) && skb_cow_head(skb, 0))) {
dev_kfree_skb_any(skb);
++(NET_STAT(jme).tx_dropped);
return NETDEV_TX_OK;
}
Expand Down

0 comments on commit ba4e6d1

Please sign in to comment.