Module Name:    src
Committed By:   pgoyette
Date:           Wed May 24 06:52:14 UTC 2017

Modified Files:
        src/sys/net: if_tun.c

Log Message:
Call cv_destroy() to deactivate the tun_cv before calling kmem_intr_free()
to deallocate the containing memory chunk (the tunnel's softc).  Otherwise
a LOCKDEBUG kernel will panic in tun_clone_destroy().

Fixes PR kern/52255


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/net/if_tun.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_tun.c
diff -u src/sys/net/if_tun.c:1.138 src/sys/net/if_tun.c:1.139
--- src/sys/net/if_tun.c:1.138	Sun Jan 29 18:30:33 2017
+++ src/sys/net/if_tun.c	Wed May 24 06:52:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tun.c,v 1.138 2017/01/29 18:30:33 maya Exp $	*/
+/*	$NetBSD: if_tun.c,v 1.139 2017/05/24 06:52:14 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1988, Julian Onions <j...@cs.nott.ac.uk>
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.138 2017/01/29 18:30:33 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.139 2017/05/24 06:52:14 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -303,6 +303,7 @@ tun_clone_destroy(struct ifnet *ifp)
 		softint_disestablish(tp->tun_osih);
 		softint_disestablish(tp->tun_isih);
 		mutex_destroy(&tp->tun_lock);
+		cv_destroy(&tp->tun_cv);
 		kmem_free(tp, sizeof(*tp));
 	}
 

Reply via email to