aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2010-03-13 15:27:21 -0500
committerDavid S. Miller <davem@davemloft.net>2010-03-13 15:27:21 -0500
commitbec68ff1637ca00bb1585a03a7be8a13380084de (patch)
tree2e1f14359ab479d1429bbdfcecb2897b5fa4e667 /net
parentc251c7f738cd94eb3a1febda318078c661eccb4d (diff)
bridge: ensure to unlock in error path in br_multicast_query().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/br_multicast.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 12ce1eaa4f3e..fd96a8dc97f4 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -823,6 +823,7 @@ static int br_multicast_query(struct net_bridge *br,
823 unsigned long max_delay; 823 unsigned long max_delay;
824 unsigned long now = jiffies; 824 unsigned long now = jiffies;
825 __be32 group; 825 __be32 group;
826 int err = 0;
826 827
827 spin_lock(&br->multicast_lock); 828 spin_lock(&br->multicast_lock);
828 if (!netif_running(br->dev) || 829 if (!netif_running(br->dev) ||
@@ -841,12 +842,14 @@ static int br_multicast_query(struct net_bridge *br,
841 group = 0; 842 group = 0;
842 } 843 }
843 } else { 844 } else {
844 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) 845 if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) {
845 return -EINVAL; 846 err = -EINVAL;
847 goto out;
848 }
846 849
847 ih3 = igmpv3_query_hdr(skb); 850 ih3 = igmpv3_query_hdr(skb);
848 if (ih3->nsrcs) 851 if (ih3->nsrcs)
849 return 0; 852 goto out;
850 853
851 max_delay = ih3->code ? 1 : 854 max_delay = ih3->code ? 1 :
852 IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE); 855 IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE);
@@ -876,7 +879,7 @@ static int br_multicast_query(struct net_bridge *br,
876 879
877out: 880out:
878 spin_unlock(&br->multicast_lock); 881 spin_unlock(&br->multicast_lock);
879 return 0; 882 return err;
880} 883}
881 884
882static void br_multicast_leave_group(struct net_bridge *br, 885static void br_multicast_leave_group(struct net_bridge *br,