Skip to contentSkip to conversation

: Adjust the zeroing up to tail in __alloc_skb too

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Mar 20, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Adjust the zeroing up to tail in __alloc_skb too

I did it just in alloc_skb_from_cache, forgot __alloc_skb, fixed now.

---
 net/core/skbuff.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
net/core/skbuff.c +4 -1
index c274ea3..d7d2dc3 100644
@@ -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;
Signature · 1 line
1.5.0.3