Skip to content

Commit

Permalink
kernel/kmod.c: document call_usermodehelper_fns() a bit
Browse files Browse the repository at this point in the history
This function's interface is, uh, subtle.  Attempt to apologise for it.

Cc: WANG Cong <xiyou.wangcong@gmail.com>
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: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
akpm00 authored and torvalds committed Jul 31, 2012
1 parent deb8274 commit 79c743d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/kmod.c
Expand Up @@ -577,6 +577,12 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
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),
Expand Down

0 comments on commit 79c743d

Please sign in to comment.