summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorgnn <gnn@FreeBSD.org>2014-01-16 22:14:54 +0000
committergnn <gnn@FreeBSD.org>2014-01-16 22:14:54 +0000
commit61b11742063d9db90d9b8107dbe80caa02b25f1e (patch)
tree7a6ead1b269f192a1b43a6b97a8ff8d8d31ac41b /sys/netinet
parent06cb3d4dfd897c7a7ccc772f90d43da4b13194a1 (diff)
downloadFreeBSD-src-61b11742063d9db90d9b8107dbe80caa02b25f1e.zip
FreeBSD-src-61b11742063d9db90d9b8107dbe80caa02b25f1e.tar.gz
Fix various places where we don't properly release a lock
PR: 185043 Submitted by: Michael Bentkofsky MFC after: 2 weeks
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_mcast.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index 621957e..d996bd1 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -1496,7 +1496,7 @@ inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt)
error = inm_merge(inm, imf);
if (error) {
CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__);
- goto out_imf_rollback;
+ goto out_in_multi_locked;
}
CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__);
@@ -1504,6 +1504,8 @@ inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt)
if (error)
CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__);
+out_in_multi_locked:
+
IN_MULTI_UNLOCK();
out_imf_rollback:
@@ -2172,8 +2174,12 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt)
if (is_new) {
error = in_joingroup_locked(ifp, &gsa->sin.sin_addr, imf,
&inm);
- if (error)
+ if (error) {
+ CTR1(KTR_IGMPV3, "%s: in_joingroup_locked failed",
+ __func__);
+ IN_MULTI_UNLOCK();
goto out_imo_free;
+ }
imo->imo_membership[idx] = inm;
} else {
CTR1(KTR_IGMPV3, "%s: merge inm state", __func__);
@@ -2181,20 +2187,21 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt)
if (error) {
CTR1(KTR_IGMPV3, "%s: failed to merge inm state",
__func__);
- goto out_imf_rollback;
+ goto out_in_multi_locked;
}
CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__);
error = igmp_change_state(inm);
if (error) {
CTR1(KTR_IGMPV3, "%s: failed igmp downcall",
__func__);
- goto out_imf_rollback;
+ goto out_in_multi_locked;
}
}
+out_in_multi_locked:
+
IN_MULTI_UNLOCK();
-out_imf_rollback:
INP_WLOCK_ASSERT(inp);
if (error) {
imf_rollback(imf);
@@ -2398,7 +2405,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt)
if (error) {
CTR1(KTR_IGMPV3, "%s: failed to merge inm state",
__func__);
- goto out_imf_rollback;
+ goto out_in_multi_locked;
}
CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__);
@@ -2409,9 +2416,10 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt)
}
}
+out_in_multi_locked:
+
IN_MULTI_UNLOCK();
-out_imf_rollback:
if (error)
imf_rollback(imf);
else
@@ -2645,7 +2653,7 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
error = inm_merge(inm, imf);
if (error) {
CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__);
- goto out_imf_rollback;
+ goto out_in_multi_locked;
}
CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__);
@@ -2653,6 +2661,8 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt)
if (error)
CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__);
+out_in_multi_locked:
+
IN_MULTI_UNLOCK();
out_imf_rollback:
OpenPOWER on IntegriCloud