]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/user.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / kernel / user.c
index e91331c457e270e8ca7aaa7f91a2f45ecde2dcc8..8320a87f3e5a11f11e2159488cf2dc3f6d9371d3 100644 (file)
@@ -129,7 +129,7 @@ static inline void uids_mutex_unlock(void)
 }
 
 /* return cpu shares held by the user */
-ssize_t cpu_shares_show(struct kset *kset, char *buffer)
+static ssize_t cpu_shares_show(struct kset *kset, char *buffer)
 {
        struct user_struct *up = container_of(kset, struct user_struct, kset);
 
@@ -137,7 +137,8 @@ ssize_t cpu_shares_show(struct kset *kset, char *buffer)
 }
 
 /* modify cpu shares held by the user */
-ssize_t cpu_shares_store(struct kset *kset, const char *buffer, size_t size)
+static ssize_t cpu_shares_store(struct kset *kset, const char *buffer,
+                               size_t size)
 {
        struct user_struct *up = container_of(kset, struct user_struct, kset);
        unsigned long shares;
@@ -336,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);
@@ -354,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;
                }
 
@@ -361,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;
                }