Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /kernel/kmod.c

Filename:/kernel/kmod.c
Lines Added:6
Lines Deleted:7
Also changed in: (Previous) 2.6.24-rc8-git8  2.6.24-rc8-git7  2.6.24-rc8-git6  2.6.24-rc8-git5  2.6.24-rc8-git4  2.6.24-rc8-git3 
(Following) 2.6.25-rc1-git4  2.6.25-rc2  2.6.25-rc3  2.6.25-rc4  2.6.25-rc5  2.6.25-rc6 

Location
[  2.6.24
  [  kernel
     o  kmod.c

Patch

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;
 }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.