diff options
author | Denis V. Lunev <den@openvz.org> | 2008-02-09 23:22:26 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-09 23:22:26 -0800 |
commit | cd557bc1c15cbd20fbea47a150e1c7e56834e627 (patch) | |
tree | 1bc82bff8c7f1a69f7f87a4c728e3890e5343025 | |
parent | bd2f747658b303d9b08d2c5bc815022d825a5e3c (diff) |
[IGMP]: Optimize kfree_skb in igmp_rcv.
Merge error paths inside igmp_rcv.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/igmp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 994648be80a..732cd07e607 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -922,13 +922,11 @@ int igmp_rcv(struct sk_buff *skb) struct in_device *in_dev = in_dev_get(skb->dev); int len = skb->len; - if (in_dev==NULL) { - kfree_skb(skb); - return 0; - } + if (in_dev == NULL) + goto drop; if (!pskb_may_pull(skb, sizeof(struct igmphdr))) - goto drop; + goto drop_ref; switch (skb->ip_summed) { case CHECKSUM_COMPLETE: @@ -938,7 +936,7 @@ int igmp_rcv(struct sk_buff *skb) case CHECKSUM_NONE: skb->csum = 0; if (__skb_checksum_complete(skb)) - goto drop; + goto drop_ref; } ih = igmp_hdr(skb); @@ -972,8 +970,9 @@ int igmp_rcv(struct sk_buff *skb) break; } -drop: +drop_ref: in_dev_put(in_dev); +drop: kfree_skb(skb); return 0; } |