Module Name: src
Committed By: yamt
Date: Fri Feb 25 22:35:38 UTC 2011
Modified Files:
src/sys/dev/tprof: tprof.c
Log Message:
tprof_start: don't forget to restore refcount when failed to start backend.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/tprof/tprof.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/tprof/tprof.c
diff -u src/sys/dev/tprof/tprof.c:1.8 src/sys/dev/tprof/tprof.c:1.9
--- src/sys/dev/tprof/tprof.c:1.8 Sat Feb 5 14:04:40 2011
+++ src/sys/dev/tprof/tprof.c Fri Feb 25 22:35:38 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: tprof.c,v 1.8 2011/02/05 14:04:40 yamt Exp $ */
+/* $NetBSD: tprof.c,v 1.9 2011/02/25 22:35:38 yamt Exp $ */
/*-
* Copyright (c)2008,2009,2010 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tprof.c,v 1.8 2011/02/05 14:04:40 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof.c,v 1.9 2011/02/25 22:35:38 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -295,6 +295,8 @@
error = tb->tb_ops->tbo_start(NULL);
if (error != 0) {
+ KASSERT(tb->tb_usecount > 0);
+ tb->tb_usecount--;
tprof_stop1();
goto done;
}