svn commit: r261425 - stable/10/sys/netinet

George V. Neville-Neil gnn at FreeBSD.org
Mon Feb 3 03:31:36 UTC 2014


Author: gnn
Date: Mon Feb  3 03:31:35 2014
New Revision: 261425
URL: http://svnweb.freebsd.org/changeset/base/261425

Log:
  MFC 260796
  
  Fix various places where we don't properly release a lock
  
  PR:		185043
  Submitted by:	Michael Bentkofsky

Modified:
  stable/10/sys/netinet/in_mcast.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/in_mcast.c
==============================================================================
--- stable/10/sys/netinet/in_mcast.c	Mon Feb  3 02:56:23 2014	(r261424)
+++ stable/10/sys/netinet/in_mcast.c	Mon Feb  3 03:31:35 2014	(r261425)
@@ -1452,7 +1452,7 @@ inp_block_unblock_source(struct inpcb *i
 	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__);
@@ -1460,6 +1460,8 @@ inp_block_unblock_source(struct inpcb *i
 	if (error)
 		CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__);
 
+out_in_multi_locked:
+
 	IN_MULTI_UNLOCK();
 
 out_imf_rollback:
@@ -2128,8 +2130,12 @@ inp_join_group(struct inpcb *inp, struct
 	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__);
@@ -2137,20 +2143,21 @@ inp_join_group(struct inpcb *inp, struct
 		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);
@@ -2354,7 +2361,7 @@ inp_leave_group(struct inpcb *inp, struc
 		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__);
@@ -2365,9 +2372,10 @@ inp_leave_group(struct inpcb *inp, struc
 		}
 	}
 
+out_in_multi_locked:
+
 	IN_MULTI_UNLOCK();
 
-out_imf_rollback:
 	if (error)
 		imf_rollback(imf);
 	else
@@ -2601,7 +2609,7 @@ inp_set_source_filters(struct inpcb *inp
 	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__);
@@ -2609,6 +2617,8 @@ inp_set_source_filters(struct inpcb *inp
 	if (error)
 		CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__);
 
+out_in_multi_locked:
+
 	IN_MULTI_UNLOCK();
 
 out_imf_rollback:


More information about the svn-src-all mailing list