Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e8869bb699d50be5c0733edfc71cfcd5b43e10a
Commit:     5e8869bb699d50be5c0733edfc71cfcd5b43e10a
Parent:     2ffbb8377c7a0713baf6644e285adc27a5654582
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 26 21:21:49 2007 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Nov 26 21:21:49 2007 +0100

    sched: don't forget to unlock uids_mutex on error paths
    
    The commit
    
     commit 5cb350baf580017da38199625b7365b1763d7180
     Author: Dhaval Giani <[EMAIL PROTECTED]>
     Date:   Mon Oct 15 17:00:14 2007 +0200
    
        sched: group scheduling, sysfs tunables
    
    introduced the uids_mutex and the helpers to lock/unlock it.
    Unfortunately, the error paths of alloc_uid() were not patched
    to unlock it.
    
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Acked-by: Dhaval Giani <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/user.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kernel/user.c b/kernel/user.c
index 0f3aa02..8320a87 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -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;
                }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to