Skip to content

Commit

Permalink
[PATCH] fix create_write_pipe() error check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mita authored and Linus Torvalds committed Nov 29, 2006
1 parent 967bf62 commit 3cce485
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/kmod.c
Expand Up @@ -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;

Expand Down

0 comments on commit 3cce485

Please sign in to comment.