generic, x86: add prctl commands PR_GET_TSC and PR_SET_TSC
[pandora-kernel.git] / kernel / kmod.c
index 9809cc1..22be3ff 100644 (file)
@@ -173,10 +173,7 @@ static int ____call_usermodehelper(void *data)
         */
        set_user_nice(current, 0);
 
-       retval = -EPERM;
-       if (current->fs->root)
-               retval = kernel_execve(sub_info->path,
-                               sub_info->argv, sub_info->envp);
+       retval = kernel_execve(sub_info->path, sub_info->argv, sub_info->envp);
 
        /* Exec failed? */
        sub_info->retval = retval;
@@ -451,13 +448,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 +463,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;
 }
@@ -505,7 +501,7 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
        if (ret < 0)
                goto out;
 
-       return call_usermodehelper_exec(sub_info, 1);
+       return call_usermodehelper_exec(sub_info, UMH_WAIT_EXEC);
 
   out:
        call_usermodehelper_freeinfo(sub_info);