Skip to contentSkip to conversation

fix for crash in adummy_init()

PATCH Applied [email protected] 2 participants 2 messages Feb 6, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/11 fix for crash in adummy_init()

From: Daniel Walker <[email protected]>

This was reported by Ingo Molnar here,

http://lkml.org/lkml/2006/12/18/119

The problem is that adummy_init() depends on atm_init() , but adummy_init() is called first.

So I put atm_init() into subsys_initcall which seems appropriate, and it will still get module_init() if it becomes a module.

Interesting to note that you could crash your system here if you just load the modules in the wrong order.

---

 net/atm/common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/atm/common.c renamed from net/atm/common.c~fix-for-crash-in-adummy_init +2 -1
diff -puN net/atm/common.c~fix-for-crash-in-adummy_init net/atm/common.c
@@ -816,7 +816,8 @@ static void __exit atm_exit(void)
 	proto_unregister(&vcc_proto);
 }
 
-module_init(atm_init);
+subsys_initcall(atm_init);
+
 module_exit(atm_exit);
 
 MODULE_LICENSE("GPL");

_

maintainer Applied
#1 lore raw

From: [email protected]
Date: Mon, 05 Feb 2007 16:30:56 -0800

Quoted 12 lines

From: Daniel Walker <[email protected]>

This was reported by Ingo Molnar here,

http://lkml.org/lkml/2006/12/18/119

The problem is that adummy_init() depends on atm_init() , but adummy_init() is called first.

So I put atm_init() into subsys_initcall which seems appropriate, and it will still get module_init() if it becomes a module.

Quoted 7 lines

Interesting to note that you could crash your system here if you just load the modules in the wrong order.

Applied, and I'll queue this one up for -stable too.

Thanks.