Fix ltt-relay-alloc NULL pointer exception
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 13 Jan 2011 21:43:06 +0000 (16:43 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Thu, 13 Jan 2011 21:43:06 +0000 (16:43 -0500)
repetitive load/unload of ltt-relay-alloc caused null pointer exception because
the cpu hotplug was never unregistered upon exit.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-relay-alloc.c

index 6ff552efacc06cb5506f23090a34833533e5783e..43246a73d38f7e3f9e6b929b66c6af03e99e0f38 100644 (file)
@@ -716,9 +716,14 @@ void *ltt_relay_offset_address(struct ltt_chanbuf_alloc *bufa, size_t offset)
 }
 EXPORT_SYMBOL_GPL(ltt_relay_offset_address);
 
+static struct notifier_block ltt_relay_hotcpu = {
+       .notifier_call = ltt_relay_hotcpu_callback,
+       .priority = 5,
+};
+
 static __init int ltt_relay_alloc_init(void)
 {
-       hotcpu_notifier(ltt_relay_hotcpu_callback, 5);
+       register_cpu_notifier(&ltt_relay_hotcpu);
        ltt_relay_init();
        ltt_ascii_init();
        return 0;
@@ -728,6 +733,7 @@ static void __exit ltt_relay_alloc_exit(void)
 {
        ltt_ascii_exit();
        ltt_relay_exit();
+       unregister_cpu_notifier(&ltt_relay_hotcpu);
 }
 
 module_init(ltt_relay_alloc_init);
This page took 0.026236 seconds and 4 git commands to generate.