Commit bec68ff1 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

bridge: ensure to unlock in error path in br_multicast_query().

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c251c7f7
...@@ -823,6 +823,7 @@ static int br_multicast_query(struct net_bridge *br, ...@@ -823,6 +823,7 @@ static int br_multicast_query(struct net_bridge *br,
unsigned long max_delay; unsigned long max_delay;
unsigned long now = jiffies; unsigned long now = jiffies;
__be32 group; __be32 group;
int err = 0;
spin_lock(&br->multicast_lock); spin_lock(&br->multicast_lock);
if (!netif_running(br->dev) || if (!netif_running(br->dev) ||
...@@ -841,12 +842,14 @@ static int br_multicast_query(struct net_bridge *br, ...@@ -841,12 +842,14 @@ static int br_multicast_query(struct net_bridge *br,
group = 0; group = 0;
} }
} else { } else {
if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) {
return -EINVAL; err = -EINVAL;
goto out;
}
ih3 = igmpv3_query_hdr(skb); ih3 = igmpv3_query_hdr(skb);
if (ih3->nsrcs) if (ih3->nsrcs)
return 0; goto out;
max_delay = ih3->code ? 1 : max_delay = ih3->code ? 1 :
IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE); IGMPV3_MRC(ih3->code) * (HZ / IGMP_TIMER_SCALE);
...@@ -876,7 +879,7 @@ static int br_multicast_query(struct net_bridge *br, ...@@ -876,7 +879,7 @@ static int br_multicast_query(struct net_bridge *br,
out: out:
spin_unlock(&br->multicast_lock); spin_unlock(&br->multicast_lock);
return 0; return err;
} }
static void br_multicast_leave_group(struct net_bridge *br, static void br_multicast_leave_group(struct net_bridge *br,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment