From 769b62a02f62ff8db93f109d9f63a1df6ea9990b Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 1 Sep 2016 17:52:09 -0400 Subject: [PATCH] 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 --- lib/ringbuffer/ring_buffer_backend.c | 1 + 1 file changed, 1 insertion(+) 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 -- 2.34.1