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.9.0-rc1~20 X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=commitdiff_plain;h=769b62a02f62ff8db93f109d9f63a1df6ea9990b 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