1
0
Fork 0

[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>
hifive-unleashed-5.1
Akinobu Mita 2006-11-28 12:29:43 -08:00 committed by Linus Torvalds
parent 967bf623e9
commit 3cce4856ff
1 changed files with 4 additions and 4 deletions

View File

@ -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;