From: Francis Deslauriers Date: Tue, 1 Oct 2019 13:35:19 +0000 (-0400) Subject: Cleanup: relayd: identical code for different branches X-Git-Tag: v2.11.0~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d2f324fa7a4bfc29bcc2e7fd80e074768afec53f;p=lttng-tools.git Cleanup: relayd: identical code for different branches Coverity report: CID 1404928 (#1 of 1): Identical code for different branches (IDENTICAL_BRANCHES)identical_branches: The same code is executed when the condition ret < 0 is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed? Reported-by: Coverity (1404928) Identical code for different branches Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/stream.c b/src/bin/lttng-relayd/stream.c index 06e82b291..1b4e38ac8 100644 --- a/src/bin/lttng-relayd/stream.c +++ b/src/bin/lttng-relayd/stream.c @@ -1133,9 +1133,7 @@ int stream_complete_packet(struct relay_stream *stream, size_t packet_total_size stream->prev_data_seq = sequence_number; ret = try_rotate_stream_data(stream); - if (ret < 0) { - goto end; - } + end: return ret; }