Module Name: src
Committed By: ozaki-r
Date: Tue Jan 30 10:40:02 UTC 2018
Modified Files:
src/sys/net: if.c
Log Message:
Destroy ifq_lock at the end of if_detach
It still can be used in if_detach.
To generate a diff of this commit:
cvs rdiff -u -r1.418 -r1.419 src/sys/net/if.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.418 src/sys/net/if.c:1.419
--- src/sys/net/if.c:1.418 Wed Jan 10 01:22:26 2018
+++ src/sys/net/if.c Tue Jan 30 10:40:02 2018
@@ -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 @@ if_detach(struct ifnet *ifp)
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 @@ again:
mutex_obj_free(ifp->if_ioctl_lock);
ifp->if_ioctl_lock = NULL;
+ mutex_obj_free(ifp->if_snd.ifq_lock);
splx(s);