Cleanup error handling in open_channel
[ust.git] / libust / buffers.c
index 2e6a16181c25ceea46a8ba031eaa87037dfb6352..4011b64310f6791d12318f7e41dc62cd9825a7f4 100644 (file)
@@ -319,13 +319,10 @@ static int open_channel(struct ust_channel *chan, size_t subbuf_size,
 
        return 0;
 
-       /* Jump directly inside the loop to close the buffers that were already
-        * opened. */
-       for(; i>=0; i--) {
-               close_buf(chan->buf[i]);
+       /* Error handling */
 error:
-               do {} while(0);
-       }
+       for(i--; i >= 0; i--)
+               close_buf(chan->buf[i]);
 
        pthread_mutex_unlock(&ust_buffers_channels_mutex);
        return -1;
@@ -1243,6 +1240,10 @@ size_t ltt_write_event_header_slow(struct ust_channel *channel,
        case LTT_RFLAG_ID:
                header.id_time = 31 << LTT_TSC_BITS;
                break;
+       default:
+               WARN_ON_ONCE(1);
+               header.id_time = 0;
+               break;
        }
 
        header.id_time |= (u32)tsc & LTT_TSC_MASK;
This page took 0.023557 seconds and 4 git commands to generate.