Messages in this thread Patch in this message | | | From | Cong Wang <> | Subject | [Patch] kernel/sys.c: fix an incorrect error branch in orderly_poweroff() | Date | Wed, 4 Jul 2012 11:31:47 +0800 |
| |
From: WANG Cong <xiyou.wangcong@gmail.com>
When argv_split() fails, argv is NULL, thus we should avoid calling agrv_free(argv), and should jump after it.
Cc: Cyrill Gorcunov <gorcunov@openvz.org> Cc: Kees Cook <keescook@chromium.org> Cc: Serge Hallyn <serge.hallyn@canonical.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
--- diff --git a/kernel/sys.c b/kernel/sys.c index e0c8ffc..ffa510f 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2217,13 +2217,13 @@ int orderly_poweroff(bool force) ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT, NULL, argv_cleanup, NULL); -out: if (likely(!ret)) return 0; if (ret == -ENOMEM) argv_free(argv); +out: if (force) { printk(KERN_WARNING "Failed to start orderly shutdown: " "forcing the issue\n");
| |