aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-02-07 19:54:14 -0800
committerDavid S. Miller <davem@davemloft.net>2011-02-07 19:54:14 -0800
commit429a01a70f301baf0c8fc780f891a18c296d5e24 (patch)
tree663ee8a8c0a47d364648d5f905f185e875e48d62 /net
parent95c3043008ca8449feb96aba5481fe31c2ea750b (diff)
parent531c9da8c854c5b075383253a57fdd4e0be82e99 (diff)
downloadkernel_samsung_crespo-429a01a70f301baf0c8fc780f891a18c296d5e24.zip
kernel_samsung_crespo-429a01a70f301baf0c8fc780f891a18c296d5e24.tar.gz
kernel_samsung_crespo-429a01a70f301baf0c8fc780f891a18c296d5e24.tar.bz2
Merge branch 'batman-adv/merge' of git://git.open-mesh.org/ecsv/linux-merge
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/unicast.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index ee41fef..d1a6113 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -50,12 +50,12 @@ static struct sk_buff *frag_merge_packet(struct list_head *head,
skb = tfp->skb;
}
+ if (skb_linearize(skb) < 0 || skb_linearize(tmp_skb) < 0)
+ goto err;
+
skb_pull(tmp_skb, sizeof(struct unicast_frag_packet));
- if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0) {
- /* free buffered skb, skb will be freed later */
- kfree_skb(tfp->skb);
- return NULL;
- }
+ if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0)
+ goto err;
/* move free entry to end */
tfp->skb = NULL;
@@ -70,6 +70,11 @@ static struct sk_buff *frag_merge_packet(struct list_head *head,
unicast_packet->packet_type = BAT_UNICAST;
return skb;
+
+err:
+ /* free buffered skb, skb will be freed later */
+ kfree_skb(tfp->skb);
+ return NULL;
}
static void frag_create_entry(struct list_head *head, struct sk_buff *skb)