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

[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
...@@ -307,14 +307,14 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp, ...@@ -307,14 +307,14 @@ int call_usermodehelper_pipe(char *path, char **argv, char **envp,
return 0; return 0;
f = create_write_pipe(); f = create_write_pipe();
if (!f) if (IS_ERR(f))
return -ENOMEM; return PTR_ERR(f);
*filp = f; *filp = f;
f = create_read_pipe(f); f = create_read_pipe(f);
if (!f) { if (IS_ERR(f)) {
free_write_pipe(*filp); free_write_pipe(*filp);
return -ENOMEM; return PTR_ERR(f);
} }
sub_info.stdin = f; sub_info.stdin = f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment