summaryrefslogtreecommitdiffstats
path: root/freed-ora/current/f14/utrace-remove-use-of-kref_set.patch
blob: f696f81fbc90db179173504f762c4fd0a37297fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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

OpenPOWER on IntegriCloud