Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/spi Don't leak condvars and mutexes, even if they ar...



details:   https://anonhg.NetBSD.org/src/rev/11214d934d09
branches:  trunk
changeset: 783701:11214d934d09
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Jan 04 22:23:06 2013 +0000

description:
Don't leak condvars and mutexes, even if they are on the stack.
Fixes LOCKDEBUG asserts when a mutex/condvar is initialized at the same
stack address as a previous initialization.  We probably want to revisit
the transfer structure lifecyle at some point in the future.

diffstat:

 sys/dev/spi/spi.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 3b24e379fd13 -r 11214d934d09 sys/dev/spi/spi.c
--- a/sys/dev/spi/spi.c Fri Jan 04 21:00:23 2013 +0000
+++ b/sys/dev/spi/spi.c Fri Jan 04 22:23:06 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.6 2011/07/08 03:29:15 mrg Exp $ */
+/* $NetBSD: spi.c,v 1.7 2013/01/04 22:23:06 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.6 2011/07/08 03:29:15 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.7 2013/01/04 22:23:06 jakllsch Exp $");
 
 #include "locators.h"
 
@@ -276,6 +276,8 @@
                cv_wait(&st->st_cv, &st->st_lock);
        }
        mutex_exit(&st->st_lock);
+       cv_destroy(&st->st_cv);
+       mutex_destroy(&st->st_lock);
 }
 
 void



Home | Main Index | Thread Index | Old Index