port fix from lttng kernel tracer 0.92
[ust.git] / libust / buffers.c
index f3331d0899f523677be93f7c5e17b84007d9ee38..c2928c03092fa77417d33e8368ebd5306f56a36d 100644 (file)
@@ -250,13 +250,13 @@ void *ltt_buffers_offset_address(struct ust_buffer *buf, size_t offset)
 
 /* FIXME: does this test work properly? */
 #if (BITS_PER_LONG == 32)
-static inline void save_last_tsc(struct ltt_channel_buf_struct *ltt_buf,
+static inline void save_last_tsc(struct ust_buffer *ltt_buf,
                                        u64 tsc)
 {
        ltt_buf->last_tsc = (unsigned long)(tsc >> LTT_TSC_BITS);
 }
 
-static inline int last_tsc_overflow(struct ltt_channel_buf_struct *ltt_buf,
+static inline int last_tsc_overflow(struct ust_buffer *ltt_buf,
                                        u64 tsc)
 {
        unsigned long tsc_shifted = (unsigned long)(tsc >> LTT_TSC_BITS);
@@ -482,6 +482,13 @@ static void ltt_relay_print_errors(struct ltt_trace_struct *trace,
        struct ust_buffer *ltt_buf = channel->buf;
        long cons_off;
 
+       /*
+        * Can be called in the error path of allocation when
+        * trans_channel_data is not yet set.
+        */
+       if (!channel)
+               return;
+
        for (cons_off = atomic_long_read(&ltt_buf->consumed);
                        (SUBBUF_TRUNC(local_read(&ltt_buf->offset),
                                      channel)
This page took 0.022964 seconds and 4 git commands to generate.