lib ring buffer frontend: add missing lock initialization
[lttng-modules.git] / lib / ringbuffer / ring_buffer_frontend.c
index 6a4c241e84677e3f14f14aee282d0a00a418830a..a45373b062d4bd5ae95b0519170b0c9e51224961 100644 (file)
@@ -752,8 +752,8 @@ void *channel_destroy(struct channel *chan)
        ACCESS_ONCE(chan->finalized) = 1;
        wake_up_interruptible(&chan->hp_wait);
        wake_up_interruptible(&chan->read_wait);
-       kref_put(&chan->ref, channel_release);
        priv = chan->backend.priv;
+       kref_put(&chan->ref, channel_release);
        return priv;
 }
 EXPORT_SYMBOL_GPL(channel_destroy);
@@ -1702,3 +1702,11 @@ int lib_ring_buffer_reserve_slow(struct lib_ring_buffer_ctx *ctx)
        return 0;
 }
 EXPORT_SYMBOL_GPL(lib_ring_buffer_reserve_slow);
+
+void __init init_lib_ring_buffer_frontend(void)
+{
+       int cpu;
+
+       for_each_possible_cpu(cpu)
+               spin_lock_init(&per_cpu(ring_buffer_nohz_lock, cpu));
+}
This page took 0.023747 seconds and 4 git commands to generate.