From: Mathieu Desnoyers Date: Wed, 23 Feb 2011 04:22:44 +0000 (-0500) Subject: Cleanup error handling in open_channel X-Git-Tag: v0.12~33 X-Git-Url: https://git.lttng.org/?p=ust.git;a=commitdiff_plain;h=b2ccc23151c949c88ab37929000ec0bb83d5456d Cleanup error handling in open_channel Reported-by: Yannick Brosseau Signed-off-by: Mathieu Desnoyers --- diff --git a/libust/buffers.c b/libust/buffers.c index 4e8004c..4011b64 100644 --- a/libust/buffers.c +++ b/libust/buffers.c @@ -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;