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.7.5~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=364754c1f9e7c6237fe7627e701fa543d60ca353;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 5417648a..ad761136 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -421,6 +421,7 @@ free_bufs: } #ifdef CONFIG_HOTPLUG_CPU put_online_cpus(); + unregister_hotcpu_notifier(&chanb->cpu_hp_notifier); #endif free_percpu(chanb->buf); } else