Source-Changes-HG archive

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

[src/trunk]: src/sys/net Call cv_destroy() to deactivate the tun_cv before ca...



details:   https://anonhg.NetBSD.org/src/rev/d880a356ace4
branches:  trunk
changeset: 824111:d880a356ace4
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed May 24 06:52:14 2017 +0000

description:
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

diffstat:

 sys/net/if_tun.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 2ba3b9942668 -r d880a356ace4 sys/net/if_tun.c
--- a/sys/net/if_tun.c  Wed May 24 06:51:27 2017 +0000
+++ b/sys/net/if_tun.c  Wed May 24 06:52:14 2017 +0000
@@ -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 <jpo%cs.nott.ac.uk@localhost>
@@ -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 @@
                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));
        }
 



Home | Main Index | Thread Index | Old Index