From: Tetsuo Handa Date: Tue, 26 May 2009 08:11:03 +0000 (+0100) Subject: kmod: Release sub_info on cred allocation failure. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ab2b7ebaad16226c9a5e85c5f384d19fa58a7459;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Signed-off-by: David Howells Signed-off-by: Linus Torvalds --- 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;