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 | |
parent | d4a76f8a619b5d7dfd5a0f122666fee24bb3dcb9 (diff) | |
download | kernel-crypto-ab2b7ebaad16226c9a5e85c5f384d19fa58a7459.tar.gz kernel-crypto-ab2b7ebaad16226c9a5e85c5f384d19fa58a7459.tar.xz kernel-crypto-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>
-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 b750675251e..7e95bedb2bf 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; |