Jesse Keating 7a32965
From ad778e66100e4b76bab6b939e3d0c781da82d980 Mon Sep 17 00:00:00 2001
Jesse Keating 7a32965
From: Kyle McMartin <kyle@dreadnought.i.jkkm.org>
Jesse Keating 7a32965
Date: Tue, 22 Jun 2010 14:09:30 +0100
Jesse Keating 7a32965
Subject: utrace: remove use of kref_set
Jesse Keating 7a32965
Jesse Keating 7a32965
Unfortunatey db1afffa which removed kref_set did not anticipate
Jesse Keating 7a32965
anyone would actually like to use a kref which starts with a refcnt
Jesse Keating 7a32965
above 1. Replace kref_set in utrace with a kref_init + kref_get to
Jesse Keating 7a32965
immediately bump the reference count.
Jesse Keating 7a32965
Jesse Keating 7a32965
Signed-off-by: Kyle McMartin <kyle@redhat.com>
Jesse Keating 7a32965
---
Jesse Keating 7a32965
 kernel/utrace.c |    3 ++-
Jesse Keating 7a32965
 1 files changed, 2 insertions(+), 1 deletions(-)
Jesse Keating 7a32965
Jesse Keating 7a32965
diff --git a/kernel/utrace.c b/kernel/utrace.c
Jesse Keating 7a32965
index f5a9e2c..cc864d5 100644
Jesse Keating 7a32965
--- a/kernel/utrace.c
Jesse Keating 7a32965
+++ b/kernel/utrace.c
Jesse Keating 7a32965
@@ -304,7 +304,8 @@ struct utrace_engine *utrace_attach_task(
Jesse Keating 7a32965
 	 * Initialize the new engine structure.  It starts out with two
Jesse Keating 7a32965
 	 * refs: one ref to return, and one ref for being attached.
Jesse Keating 7a32965
 	 */
Jesse Keating 7a32965
-	kref_set(&engine->kref, 2);
Jesse Keating 7a32965
+	kref_init(&engine->kref);
Jesse Keating 7a32965
+	kref_get(&engine->kref);
Jesse Keating 7a32965
 	engine->flags = 0;
Jesse Keating 7a32965
 	engine->ops = ops;
Jesse Keating 7a32965
 	engine->data = data;
Jesse Keating 7a32965
-- 
Jesse Keating 7a32965
1.7.0.1
Jesse Keating 7a32965