Skip to content

Commit

Permalink
[SK_BUFF]: Adjust the zeroing up to tail in __alloc_skb too
Browse files Browse the repository at this point in the history
I did it just in alloc_skb_from_cache, forgot __alloc_skb, fixed now.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Apr 26, 2007
1 parent 4305b54 commit ca0605a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
if (!data)
goto nodata;

memset(skb, 0, offsetof(struct sk_buff, truesize));
/*
* See comment in sk_buff definition, just before the 'tail' member
*/
memset(skb, 0, offsetof(struct sk_buff, tail));
skb->truesize = size + sizeof(struct sk_buff);
atomic_set(&skb->users, 1);
skb->head = data;
Expand Down

0 comments on commit ca0605a

Please sign in to comment.