* [PATCH] fix create_write_pipe() error check
@ 2006-11-27 4:59 Akinobu Mita
0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2006-11-27 4:59 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm
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>
---
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-27 5:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-27 4:59 [PATCH] fix create_write_pipe() error check Akinobu Mita
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.