mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] futex: init error ckeck
@ 2006-11-27  4:56 Akinobu Mita
  2006-11-27 12:47 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2006-11-27  4:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar

This patch checks register_filesystem() and kern_mount() return
values.

Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 kernel/futex.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Index: work-fault-inject/kernel/futex.c
===================================================================
--- work-fault-inject.orig/kernel/futex.c
+++ work-fault-inject/kernel/futex.c
@@ -1857,10 +1857,16 @@ static struct file_system_type futex_fs_
 
 static int __init init(void)
 {
-	unsigned int i;
+	int i = register_filesystem(&futex_fs_type);
+
+	if (i)
+		return i;
 
-	register_filesystem(&futex_fs_type);
 	futex_mnt = kern_mount(&futex_fs_type);
+	if (IS_ERR(futex_mnt)) {
+		unregister_filesystem(&futex_fs_type);
+		return PTR_ERR(futex_mnt);
+	}
 
 	for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
 		INIT_LIST_HEAD(&futex_queues[i].chain);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] futex: init error ckeck
  2006-11-27  4:56 [PATCH] futex: init error ckeck Akinobu Mita
@ 2006-11-27 12:47 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2006-11-27 12:47 UTC (permalink / raw)
  To: Akinobu Mita, linux-kernel


* Akinobu Mita <akinobu.mita@gmail.com> wrote:

> This patch checks register_filesystem() and kern_mount() return
> values.
> 
> Cc: Ingo Molnar <mingo@redhat.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

thanks.

Acked-by: Ingo Molnar <mingo@elte.hu>

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-28  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-27  4:56 [PATCH] futex: init error ckeck Akinobu Mita
2006-11-27 12:47 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®