commit 3cce4856ff3dfa663b1a168dab48120d70820da6
tree 8d71aa53cff785eb89acd2499179deaf8bc44ca3
parent 967bf623e9f5eecfb056b1ba7e0efd74a21c9c3a
author Akinobu Mita <[EMAIL PROTECTED]> 1164745783 -0800
committer Linus Torvalds <[EMAIL PROTECTED]> 1164763610 -0800

[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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 kernel/kmod.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/kmod.c b/kernel/kmod.c
index bb4e29d..2b76dee 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -307,14 +307,14 @@ int call_usermodehelper_pipe(char *path,
                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;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to