From: Mathieu Desnoyers Date: Thu, 13 Jan 2011 21:43:06 +0000 (-0500) Subject: Fix ltt-relay-alloc NULL pointer exception X-Git-Tag: v0.19.6~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=031e36b31fc9aa1ca6dcaa35091bffa3b4b59555;p=lttng-modules.git 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 --- 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);