Skip to contentSkip to conversation

have sgi-gru driver call fs_initcall() if statically linked

PATCH New Dean Nelson 1 participant 1 message Nov 24, 2008 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 have sgi-gru driver call fs_initcall() if statically linked

If xpc.ko and gru.ko are both statically linked into the kernel, then xpc_init() can get called before gru_init() and make a call to one of the gru's exported functions before the gru has initialized itself. The end result is a NULL dereference.

---

 drivers/misc/sgi-gru/grufile.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/misc/sgi-gru/grufile.c +4 -0
Index: linux/drivers/misc/sgi-gru/grufile.c
===================================================================
@@ -678,7 +678,11 @@ struct vm_operations_struct gru_vm_ops =
 	.fault		= gru_fault,
 };
 
+#ifndef MODULE
+fs_initcall(gru_init);
+#else
 module_init(gru_init);
+#endif
 module_exit(gru_exit);
 
 module_param(gru_options, ulong, 0644);