diff options
author | Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> | 2009-05-26 09:11:03 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-26 12:11:19 -0700 |
commit | ab2b7ebaad16226c9a5e85c5f384d19fa58a7459 (patch) | |
tree | c7a700d9300dca0855721b3a15db150ae5d86f1b /kernel/kmod.c | |
parent | d4a76f8a619b5d7dfd5a0f122666fee24bb3dcb9 (diff) | |
download | linux-ab2b7ebaad16226c9a5e85c5f384d19fa58a7459.tar.gz linux-ab2b7ebaad16226c9a5e85c5f384d19fa58a7459.tar.bz2 linux-ab2b7ebaad16226c9a5e85c5f384d19fa58a7459.zip |
kmod: Release sub_info on cred allocation failure.
call_usermodehelper_setup() forgot to kfree(sub_info)
when prepare_usermodehelper_creds() failed.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r-- | kernel/kmod.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index b750675251e5..7e95bedb2bfc 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -370,8 +370,10 @@ struct subprocess_info *call_usermodehelper_setup(char *path, char **argv, sub_info->argv = argv; sub_info->envp = envp; sub_info->cred = prepare_usermodehelper_creds(); - if (!sub_info->cred) + if (!sub_info->cred) { + kfree(sub_info); return NULL; + } out: return sub_info; |