kernel/utrace-remove-use-of-kref_set.patch
2010-07-29 16:46:31 -07:00

33 lines
1.0 KiB
Diff

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