]> err.no Git - linux-2.6/commitdiff
[IGMP]: Optimize kfree_skb in igmp_rcv.
authorDenis V. Lunev <den@openvz.org>
Sun, 10 Feb 2008 07:22:26 +0000 (23:22 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 Feb 2008 07:22:26 +0000 (23:22 -0800)
Merge error paths inside igmp_rcv.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/igmp.c

index 994648be80ab7e3e4a60abdb3e1a28e4aae290ca..732cd07e6071bdc0aa9b514286bdd80ec934183d 100644 (file)
@@ -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;
 }