X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fkmod.c;h=bb7df2a28bd719d07978593cb10f7264b6f43f3b;hb=de7d812d05f3075096a3e37222f4e1876ae25e6c;hp=beedbdc646087783cc25fb3d68dcf9226cec4689;hpb=ce8c2293be47999584908069e78bf6d94beadc53;p=linux-2.6-omap-h63xx.git diff --git a/kernel/kmod.c b/kernel/kmod.c index beedbdc6460..bb7df2a28bd 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -351,11 +351,11 @@ static inline void register_pm_notifier_callback(void) {} /** * call_usermodehelper_setup - prepare to call a usermode helper - * @path - path to usermode executable - * @argv - arg vector for process - * @envp - environment for process + * @path: path to usermode executable + * @argv: arg vector for process + * @envp: environment for process * - * Returns either NULL on allocation failure, or a subprocess_info + * Returns either %NULL on allocation failure, or a subprocess_info * structure. This should be passed to call_usermodehelper_exec to * exec the process and free the structure. */ @@ -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; } @@ -505,7 +504,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);