|
@@ -520,13 +520,15 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
ret = call_usermodehelper_stdinpipe(sub_info, filp);
|
|
ret = call_usermodehelper_stdinpipe(sub_info, filp);
|
|
- if (ret < 0)
|
|
|
|
- goto out;
|
|
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ call_usermodehelper_freeinfo(sub_info);
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
|
|
- return call_usermodehelper_exec(sub_info, UMH_WAIT_EXEC);
|
|
|
|
|
|
+ ret = call_usermodehelper_exec(sub_info, UMH_WAIT_EXEC);
|
|
|
|
+ if (ret < 0) /* Failed to execute helper, close pipe */
|
|
|
|
+ filp_close(*filp, NULL);
|
|
|
|
|
|
- out:
|
|
|
|
- call_usermodehelper_freeinfo(sub_info);
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(call_usermodehelper_pipe);
|
|
EXPORT_SYMBOL(call_usermodehelper_pipe);
|