[PATCH] fix create_write_pipe() error check
From: Akinobu Mita
Date: Mon Nov 27 2006 - 00:06:51 EST
The return value of create_write_pipe()/create_read_pipe() should be
checked by IS_ERR().
Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/