From: Jonathan Rajotte Date: Thu, 1 Sep 2016 21:52:09 +0000 (-0400) Subject: Fix: unregister cpu hotplug notifier on buffer alloc error X-Git-Tag: v2.8.1~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=54af4470d6bbd06b28a631c74d228e3ffaeaedad;p=lttng-modules.git Fix: unregister cpu hotplug notifier on buffer alloc error The cpu hotplug notifier needs to be unregistered in the error path of buffer allocation, else it eventually causes kernel OOPS when the kernel accesses freed memory of the notifier block. Fixes #1031 Signed-off-by: Jonathan Rajotte Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c index 451ce23b..c7f2fe9d 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -422,6 +422,7 @@ free_bufs: } #ifdef CONFIG_HOTPLUG_CPU put_online_cpus(); + unregister_hotcpu_notifier(&chanb->cpu_hp_notifier); #endif free_percpu(chanb->buf); } else