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

Commit 3cce4856 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

[PATCH] fix create_write_pipe() error check



The return value of create_write_pipe()/create_read_pipe() should be
checked by IS_ERR().

Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 967bf623
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -307,14 +307,14 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
		return 0;

	f = create_write_pipe();
	if (!f)
		return -ENOMEM;
	if (IS_ERR(f))
		return PTR_ERR(f);
	*filp = f;

	f = create_read_pipe(f);
	if (!f) {
	if (IS_ERR(f)) {
		free_write_pipe(*filp);
		return -ENOMEM;
		return PTR_ERR(f);
	}
	sub_info.stdin = f;