Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net make attach and detach locking symmetric (detaching ...



details:   https://anonhg.NetBSD.org/src/rev/6e552220c84c
branches:  trunk
changeset: 821611:6e552220c84c
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 10 20:56:21 2017 +0000

description:
make attach and detach locking symmetric (detaching cloners failed)

diffstat:

 sys/net/if.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r f12ba94c96da -r 6e552220c84c sys/net/if.c
--- a/sys/net/if.c      Fri Feb 10 20:30:39 2017 +0000
+++ b/sys/net/if.c      Fri Feb 10 20:56:21 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.376 2017/02/09 09:30:26 ozaki-r Exp $ */
+/*     $NetBSD: if.c,v 1.377 2017/02/10 20:56:21 christos Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.376 2017/02/09 09:30:26 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.377 2017/02/10 20:56:21 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1653,9 +1653,10 @@
 if_clone_detach(struct if_clone *ifc)
 {
 
-       KASSERT(mutex_owned(&if_clone_mtx));
+       mutex_enter(&if_clone_mtx);
        LIST_REMOVE(ifc, ifc_list);
        if_cloners_count--;
+       mutex_exit(&if_clone_mtx);
 }
 
 /*



Home | Main Index | Thread Index | Old Index