From: Akinobu Mita Date: Tue, 28 Nov 2006 20:29:43 +0000 (-0800) Subject: [PATCH] fix create_write_pipe() error check X-Git-Tag: v2.6.19~12 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cce4856ff3dfa663b1a168dab48120d70820da6;p=linux-2.6 [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/kmod.c b/kernel/kmod.c index bb4e29d924..2b76dee284 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -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;