[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>
This commit is contained in:
Denis V. Lunev 2008-02-09 23:22:26 -08:00 committed by David S. Miller
parent bd2f747658
commit cd557bc1c1
1 changed files with 6 additions and 7 deletions

View File

@ -922,13 +922,11 @@ int igmp_rcv(struct sk_buff *skb)
struct in_device *in_dev = in_dev_get(skb->dev); struct in_device *in_dev = in_dev_get(skb->dev);
int len = skb->len; int len = skb->len;
if (in_dev==NULL) { if (in_dev == NULL)
kfree_skb(skb); goto drop;
return 0;
}
if (!pskb_may_pull(skb, sizeof(struct igmphdr))) if (!pskb_may_pull(skb, sizeof(struct igmphdr)))
goto drop; goto drop_ref;
switch (skb->ip_summed) { switch (skb->ip_summed) {
case CHECKSUM_COMPLETE: case CHECKSUM_COMPLETE:
@ -938,7 +936,7 @@ int igmp_rcv(struct sk_buff *skb)
case CHECKSUM_NONE: case CHECKSUM_NONE:
skb->csum = 0; skb->csum = 0;
if (__skb_checksum_complete(skb)) if (__skb_checksum_complete(skb))
goto drop; goto drop_ref;
} }
ih = igmp_hdr(skb); ih = igmp_hdr(skb);
@ -972,8 +970,9 @@ int igmp_rcv(struct sk_buff *skb)
break; break;
} }
drop: drop_ref:
in_dev_put(in_dev); in_dev_put(in_dev);
drop:
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
} }