diff options
author | Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> | 2009-05-26 04:11:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-26 15:11:19 -0400 |
commit | ab2b7ebaad16226c9a5e85c5f384d19fa58a7459 (patch) | |
tree | c7a700d9300dca0855721b3a15db150ae5d86f1b /kernel | |
parent | d4a76f8a619b5d7dfd5a0f122666fee24bb3dcb9 (diff) |
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')
-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, | |||
370 | sub_info->argv = argv; | 370 | sub_info->argv = argv; |
371 | sub_info->envp = envp; | 371 | sub_info->envp = envp; |
372 | sub_info->cred = prepare_usermodehelper_creds(); | 372 | sub_info->cred = prepare_usermodehelper_creds(); |
373 | if (!sub_info->cred) | 373 | if (!sub_info->cred) { |
374 | kfree(sub_info); | ||
374 | return NULL; | 375 | return NULL; |
376 | } | ||
375 | 377 | ||
376 | out: | 378 | out: |
377 | return sub_info; | 379 | return sub_info; |