summaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2012-06-01 01:26:15 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 02:49:28 +0200
commit81ab6e7b26b453a795d46f2616ed0e31d97f05b9 (patch)
treea8d50eb5b35ad93b793450bfef4d90df34494a2c /kernel/sys.c
parentkmod: unexport call_usermodehelper_freeinfo() (diff)
downloadlinux-81ab6e7b26b453a795d46f2616ed0e31d97f05b9.tar.xz
linux-81ab6e7b26b453a795d46f2616ed0e31d97f05b9.zip
kmod: convert two call sites to call_usermodehelper_fns()
Both kernel/sys.c && security/keys/request_key.c where inlining the exact same code as call_usermodehelper_fns(); So simply convert these sites to directly use call_usermodehelper_fns(). Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 8b71cef3bf1a..6e81aa7e4688 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2114,7 +2114,6 @@ int orderly_poweroff(bool force)
NULL
};
int ret = -ENOMEM;
- struct subprocess_info *info;
if (argv == NULL) {
printk(KERN_WARNING "%s failed to allocate memory for \"%s\"\n",
@@ -2122,18 +2121,16 @@ int orderly_poweroff(bool force)
goto out;
}
- info = call_usermodehelper_setup(argv[0], argv, envp, GFP_ATOMIC);
- if (info == NULL) {
- argv_free(argv);
- goto out;
- }
-
- call_usermodehelper_setfns(info, NULL, argv_cleanup, NULL);
+ ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT,
+ NULL, argv_cleanup, NULL);
+out:
+ if (likely(!ret))
+ return 0;
- ret = call_usermodehelper_exec(info, UMH_NO_WAIT);
+ if (ret == -ENOMEM)
+ argv_free(argv);
- out:
- if (ret && force) {
+ if (force) {
printk(KERN_WARNING "Failed to start orderly shutdown: "
"forcing the issue\n");