forked from luck/tmp_suning_uos_patched
[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: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
967bf623e9
commit
3cce4856ff
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user