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.12.0-rc1~334 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=d2ec9b88f593043c25370f2998a52d3393d57b63 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; }