aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/user.c b/kernel/user.c
index 7f17e6e8fd65..ab4fd706993b 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -181,13 +181,12 @@ static int uids_user_create(struct user_struct *up)
181 int error; 181 int error;
182 182
183 memset(kobj, 0, sizeof(struct kobject)); 183 memset(kobj, 0, sizeof(struct kobject));
184 kobj->ktype = &uids_ktype;
185 kobj->kset = uids_kset; 184 kobj->kset = uids_kset;
186 kobject_init(kobj); 185 error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
187 kobject_set_name(&up->kobj, "%d", up->uid); 186 if (error) {
188 error = kobject_add(kobj); 187 kobject_put(kobj);
189 if (error)
190 goto done; 188 goto done;
189 }
191 190
192 kobject_uevent(kobj, KOBJ_ADD); 191 kobject_uevent(kobj, KOBJ_ADD);
193done: 192done: