Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=784680336b616dcc4c17cbd25add3b49c555cdeb
Commit:     784680336b616dcc4c17cbd25add3b49c555cdeb
Parent:     34aebfd3bdc93c0c5614f1f61e43b6ddc4be52ae
Author:     Nigel Cunningham <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 17 15:21:21 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Jan 17 15:38:59 2008 -0800

    Fix unbalanced helper_lock in kernel/kmod.c
    
    call_usermodehelper_exec() has an exit path that can leave the
    helper_lock() call at the top of the routine unbalanced.  The attached
    patch fixes this issue.
    
    Signed-off-by: Nigel Cunningham <[EMAIL PROTECTED]>
    Cc: <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/kmod.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/kernel/kmod.c b/kernel/kmod.c
index c6a4f8a..bb7df2a 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -451,13 +451,11 @@ int call_usermodehelper_exec(struct subprocess_info 
*sub_info,
                             enum umh_wait wait)
 {
        DECLARE_COMPLETION_ONSTACK(done);
-       int retval;
+       int retval = 0;
 
        helper_lock();
-       if (sub_info->path[0] == '\0') {
-               retval = 0;
+       if (sub_info->path[0] == '\0')
                goto out;
-       }
 
        if (!khelper_wq || usermodehelper_disabled) {
                retval = -EBUSY;
@@ -468,13 +466,14 @@ int call_usermodehelper_exec(struct subprocess_info 
*sub_info,
        sub_info->wait = wait;
 
        queue_work(khelper_wq, &sub_info->work);
-       if (wait == UMH_NO_WAIT) /* task has freed sub_info */
-               return 0;
+       if (wait == UMH_NO_WAIT)        /* task has freed sub_info */
+               goto unlock;
        wait_for_completion(&done);
        retval = sub_info->retval;
 
-  out:
+out:
        call_usermodehelper_freeinfo(sub_info);
+unlock:
        helper_unlock();
        return retval;
 }
-
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