aboutsummaryrefslogtreecommitdiffstats
path: root/f2.patch
blob: e778a7de3659d2463c1d38098a98d73ccf923cc9 (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
---
 kernel/user.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/kernel/user.c
+++ b/kernel/user.c
@@ -183,13 +183,15 @@ static int uids_user_create(struct user_
 	int error;
 
 	memset(kobj, 0, sizeof(struct kobject));
-	kobj->ktype = &uids_ktype;
 	kobj->parent = uids_kobj;
-	kobject_init(kobj);
-	kobject_set_name(&up->kobj, "%d", up->uid);
-	error = kobject_add(kobj);
+	error = kobject_init_name(kobj, &uids_ktype, "%d", up->uid);
 	if (error)
 		goto done;
+	error = kobject_add(kobj);
+	if (error) {
+		kobject_put(kobj);
+		goto done;
+	}
 
 	kobject_uevent(kobj, KOBJ_ADD);
 done: