From 031e36b31fc9aa1ca6dcaa35091bffa3b4b59555 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 13 Jan 2011 16:43:06 -0500 Subject: [PATCH] Fix ltt-relay-alloc NULL pointer exception 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 --- ltt-relay-alloc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ltt-relay-alloc.c b/ltt-relay-alloc.c index 6ff552ef..43246a73 100644 --- a/ltt-relay-alloc.c +++ b/ltt-relay-alloc.c @@ -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(<t_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(<t_relay_hotcpu); } module_init(ltt_relay_alloc_init); -- 2.34.1