Source-Changes-HG archive

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

[src/trunk]: src/sys/net Destroy ifq_lock at the end of if_detach



details:   https://anonhg.NetBSD.org/src/rev/2cb7d98b83a3
branches:  trunk
changeset: 829417:2cb7d98b83a3
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jan 30 10:40:02 2018 +0000

description:
Destroy ifq_lock at the end of if_detach

It still can be used in if_detach.

diffstat:

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

diffs (35 lines):

diff -r 548da400b061 -r 2cb7d98b83a3 sys/net/if.c
--- a/sys/net/if.c      Tue Jan 30 08:53:39 2018 +0000
+++ b/sys/net/if.c      Tue Jan 30 10:40:02 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.418 2018/01/10 01:22:26 ozaki-r Exp $ */
+/*     $NetBSD: if.c,v 1.419 2018/01/30 10:40:02 ozaki-r 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.418 2018/01/10 01:22:26 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.419 2018/01/30 10:40:02 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1337,8 +1337,6 @@
                altq_detach(&ifp->if_snd);
 #endif
 
-       mutex_obj_free(ifp->if_snd.ifq_lock);
-
 #if NCARP > 0
        /* Remove the interface from any carp group it is a part of.  */
        if (ifp->if_carp != NULL && ifp->if_type != IFT_CARP)
@@ -1501,6 +1499,7 @@
 
        mutex_obj_free(ifp->if_ioctl_lock);
        ifp->if_ioctl_lock = NULL;
+       mutex_obj_free(ifp->if_snd.ifq_lock);
 
        splx(s);
 



Home | Main Index | Thread Index | Old Index