public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Whine about suspicious return values from module's ->init() hook
@ 2008-02-04 15:42 Alexey Dobriyan
  2008-02-04 21:15 ` Andrew Morton
  2008-02-05  3:43 ` Rusty Russell
  0 siblings, 2 replies; 11+ messages in thread
From: Alexey Dobriyan @ 2008-02-04 15:42 UTC (permalink / raw)
  To: akpm; +Cc: rusty, linux-kernel

One head-scratching session could be noticeably shorter with this patch...

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---

 kernel/module.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2171,6 +2171,12 @@ sys_init_module(void __user *umod,
 		wake_up(&module_wq);
 		return ret;
 	}
+	if (ret > 0) {
+		printk(KERN_WARNING "%s: '%s'->init suspiciously returned %d\n"
+		       KERN_WARNING "%s: loading module anyway...\n",
+		       __func__, mod->name, ret,
+		       __func__);
+	}
 
 	/* Now it's a first class citizen! */
 	mutex_lock(&module_mutex);


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

end of thread, other threads:[~2008-03-04  3:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 15:42 [PATCH] Whine about suspicious return values from module's ->init() hook Alexey Dobriyan
2008-02-04 21:15 ` Andrew Morton
2008-02-05  3:43 ` Rusty Russell
2008-02-05  3:53   ` Andrew Morton
2008-02-05  6:08     ` Rusty Russell
2008-02-05  6:24       ` Andrew Morton
2008-02-05 22:48         ` Rusty Russell
2008-02-05 23:37           ` Andrew Morton
2008-02-06  6:55             ` Rusty Russell
2008-02-10 22:09               ` [PATCH v2] " Alexey Dobriyan
2008-03-04  3:24                 ` Rusty Russell

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