提交 3cce4856 编写于 作者: A Akinobu Mita 提交者: 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: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册