diff options
author | David S. Miller <davem@davemloft.net> | 2011-02-09 02:19:01 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-09 02:19:01 +0100 |
commit | 263fb5b1bf9265d0e4ce59ff6ea92f478b5b61ea (patch) | |
tree | 5ee497d530185d32421122729af86cf77d0dc649 /net/batman-adv/unicast.c | |
parent | net: Kill NETEVENT_PMTU_UPDATE. (diff) | |
parent | pch_can: fix module reload issue with MSI (diff) | |
download | linux-263fb5b1bf9265d0e4ce59ff6ea92f478b5b61ea.tar.xz linux-263fb5b1bf9265d0e4ce59ff6ea92f478b5b61ea.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/e1000e/netdev.c
Diffstat (limited to 'net/batman-adv/unicast.c')
-rw-r--r-- | net/batman-adv/unicast.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index cbf022cb3121..bedf29425775 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) |