linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Cong Wang <amwang@redhat.com>,
	linux-kernel@vger.kernel.org,
	WANG Cong <xiyou.wangcong@gmail.com>,
	Cyrill Gorcunov <gorcunov@openvz.org>,
	Kees Cook <keescook@chromium.org>,
	Serge Hallyn <serge.hallyn@canonical.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [Patch] kernel/sys.c: fix an incorrect error branch in orderly_poweroff()
Date: Wed, 11 Jul 2012 16:32:23 -0700	[thread overview]
Message-ID: <20120711163223.faa40af5.akpm@linux-foundation.org> (raw)
In-Reply-To: <20120711162323.9f22fa56.akpm@linux-foundation.org>


Also, the call_usermodehelper_fns() interface is rather nasty.  Let's
try to prevent mistakes:

--- a/kernel/kmod.c~a
+++ a/kernel/kmod.c
@@ -577,6 +577,12 @@ unlock:
 	return retval;
 }
 
+/*
+ * call_usermodehelper_fns() will not run the caller-provided cleanup function
+ * if a memory allocation failure is experienced.  So the caller might need to
+ * check the call_usermodehelper_fns() return value: if it is -ENOMEM, perform
+ * the necessaary cleanup within the caller.
+ */
 int call_usermodehelper_fns(
 	char *path, char **argv, char **envp, int wait,
 	int (*init)(struct subprocess_info *info, struct cred *new),
_


  reply	other threads:[~2012-07-11 23:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28 18:32 New Defects based on recent changes in Kernel code found by Coverity Scan Scan Subscription
2012-07-03 22:27 ` Andrew Morton
2012-07-03 23:05   ` Bing Zhao
2012-07-04  3:31   ` [Patch] kernel/sys.c: fix an incorrect error branch in orderly_poweroff() Cong Wang
2012-07-04  6:44     ` David Rientjes
2012-07-04  6:56     ` Cyrill Gorcunov
2012-07-05  2:59     ` Kees Cook
2012-07-11 23:23     ` Andrew Morton
2012-07-11 23:32       ` Andrew Morton [this message]
2012-07-05 15:12   ` New Defects based on recent changes in Kernel code found by Coverity Scan Love, Robert W
2012-07-05 15:33   ` Chris Mason
2012-07-05 19:44     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120711163223.faa40af5.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=amwang@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=gorcunov@openvz.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serge.hallyn@canonical.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).