summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@freescale.com>2013-04-23 17:31:34 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-04-23 20:50:19 (GMT)
commit6857284affec3a57c8edf72fbc8086ea97508832 (patch)
tree57e042c3bbaad0242f8112c4f343551733811070 /net
parente858dff4b9adc41dcf4b2f2a6f4066da8bfe45b4 (diff)
downloadlinux-fsl-qoriq-6857284affec3a57c8edf72fbc8086ea97508832.tar.xz
net: Fix skb_recycle function
skb_recycle memsets to zero a large part of the sk_buff structure, including the head_frag field. This is an information that needs to be kept even after the skb is recycled, otherwise a subseqent kfree on the recycled skb may fail. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com> Change-Id: Ieca806d86ff1e1f30712cc7caf9b72f152081e4f Reviewed-on: http://git.am.freescale.net:8181/1744 Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@freescale.com> Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com> Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com> Reviewed-by: Manoil Claudiu-B08782 <claudiu.manoil@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 59e6d12..1a9dda5 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -688,6 +688,7 @@ EXPORT_SYMBOL(consume_skb);
void skb_recycle(struct sk_buff *skb)
{
struct skb_shared_info *shinfo;
+ u8 head_frag = skb->head_frag;
skb_release_head_state(skb);
@@ -697,6 +698,7 @@ void skb_recycle(struct sk_buff *skb)
memset(skb, 0, offsetof(struct sk_buff, tail));
skb->data = skb->head + NET_SKB_PAD;
+ skb->head_frag = head_frag;
skb_reset_tail_pointer(skb);
}
EXPORT_SYMBOL(skb_recycle);