Cleanup error handling in open_channel
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 23 Feb 2011 04:22:44 +0000 (23:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 23 Feb 2011 04:22:44 +0000 (23:22 -0500)
Reported-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libust/buffers.c

index 4e8004c65e042d73e70bb175874fd279d10ab29c..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;
This page took 0.026217 seconds and 4 git commands to generate.