kernel/kmod.c: document call_usermodehelper_fns() a bit
authorAndrew Morton <[email protected]>
Mon, 30 Jul 2012 21:42:17 +0000 (14:42 -0700)
committerLinus Torvalds <[email protected]>
Tue, 31 Jul 2012 00:25:20 +0000 (17:25 -0700)
This function's interface is, uh, subtle.  Attempt to apologise for it.

Cc: WANG Cong <[email protected]>
Cc: Cyrill Gorcunov <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Rusty Russell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/kmod.c

index ff2c7cb86d770aaf51712e330dc0f1e8a72a26e6..2a8351516a0ea875a0ca062e149a76bfa9682396 100644 (file)
@@ -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),