Fix: unregister cpu hotplug notifier on buffer alloc error
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 1 Sep 2016 21:52:09 +0000 (17:52 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Sep 2016 21:57:44 +0000 (17:57 -0400)
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 <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_backend.c

index 451ce23b2eb51f5eca72dcd3a01a26097b5b1986..c7f2fe9d7b6226b33738d2fbabb379b42999ef93 100644 (file)
@@ -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
This page took 0.026012 seconds and 4 git commands to generate.