Skip to content

Commit

Permalink
[NET]: Assign skb->dev in netdev_alloc_skb
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christoph Hellwig authored and David S. Miller committed Aug 7, 2006
1 parent 766ea8c commit 7b2e497
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev,
struct sk_buff *skb;

skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);
if (likely(skb))
if (likely(skb)) {
skb_reserve(skb, NET_SKB_PAD);
skb->dev = dev;
}
return skb;
}

Expand Down

0 comments on commit 7b2e497

Please sign in to comment.