Fix: unregister cpu hotplug notifier on buffer alloc error
[lttng-modules.git] / lib / ringbuffer / ring_buffer_backend.c
index 3cc22d77b2d9ad5c2ed428fed783b9055a5f97d3..ad7611361b56aaad7805d8e579d5f1a2dc700df0 100644 (file)
@@ -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
@@ -692,8 +693,7 @@ void _lib_ring_buffer_copy_from_user_inatomic(struct lib_ring_buffer_backend *bu
                                                        + (offset & ~PAGE_MASK),
                                                        src, pagecpy) != 0;
                if (ret > 0) {
-                       offset += (pagecpy - ret);
-                       len -= (pagecpy - ret);
+                       /* Copy failed. */
                        _lib_ring_buffer_memset(bufb, offset, 0, len, 0);
                        break; /* stop copy */
                }
This page took 0.023677 seconds and 4 git commands to generate.