The return value of create_write_pipe()/create_read_pipe() should be
checked by IS_ERR().

Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>

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

Index: work-fault-inject/kernel/kmod.c
===================================================================
--- work-fault-inject.orig/kernel/kmod.c
+++ work-fault-inject/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 linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to