Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab2b7eba authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Linus Torvalds
Browse files

kmod: Release sub_info on cred allocation failure.



call_usermodehelper_setup() forgot to kfree(sub_info)
when prepare_usermodehelper_creds() failed.

Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d4a76f8a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;