]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/user.c
Driver Core: switch all dynamic ksets to kobj_sysfs_ops
[linux-2.6-omap-h63xx.git] / kernel / user.c
index 0f3aa0234107e3742b7727565b8343539df122c9..80f1116b8fcd4f3c38c0fe9e5503acce3c51e1e2 100644 (file)
@@ -198,8 +198,8 @@ int __init uids_kobject_init(void)
        int error;
 
        /* create under /sys/kernel dir */
-       uids_kobject.parent = &kernel_subsys.kobj;
-       uids_kobject.kset = &kernel_subsys;
+       uids_kobject.parent = &kernel_kset->kobj;
+       uids_kobject.kset = kernel_kset;
        kobject_set_name(&uids_kobject, "uids");
        kobject_init(&uids_kobject);
 
@@ -337,8 +337,11 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
                struct user_struct *new;
 
                new = kmem_cache_alloc(uid_cachep, GFP_KERNEL);
-               if (!new)
+               if (!new) {
+                       uids_mutex_unlock();
                        return NULL;
+               }
+
                new->uid = uid;
                atomic_set(&new->__count, 1);
                atomic_set(&new->processes, 0);
@@ -355,6 +358,7 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
 
                if (alloc_uid_keyring(new, current) < 0) {
                        kmem_cache_free(uid_cachep, new);
+                       uids_mutex_unlock();
                        return NULL;
                }
 
@@ -362,6 +366,7 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
                        key_put(new->uid_keyring);
                        key_put(new->session_keyring);
                        kmem_cache_free(uid_cachep, new);
+                       uids_mutex_unlock();
                        return NULL;
                }