Module Name: src
Committed By: jakllsch
Date: Fri Jan 4 22:23:06 UTC 2013
Modified Files:
src/sys/dev/spi: spi.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/spi/spi.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/dev/spi/spi.c
diff -u src/sys/dev/spi/spi.c:1.6 src/sys/dev/spi/spi.c:1.7
--- src/sys/dev/spi/spi.c:1.6 Fri Jul 8 03:29:15 2011
+++ src/sys/dev/spi/spi.c Fri Jan 4 22:23:06 2013
@@ -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 @@ spi_wait(struct spi_transfer *st)
cv_wait(&st->st_cv, &st->st_lock);
}
mutex_exit(&st->st_lock);
+ cv_destroy(&st->st_cv);
+ mutex_destroy(&st->st_lock);
}
void