From: Francis Deslauriers Date: Tue, 28 Aug 2018 15:25:01 +0000 (-0400) Subject: Fix: Remove dead code in fd passing function X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=3d8e5be7ac1d25649786f56a2bea1740b34aad98 Fix: Remove dead code in fd passing function Found by Coverity: CID 1395190 (#1 of 1): Logically dead code (DEADCODE) dead_error_begin: Execution cannot reach this statement: fprintf(stderr, "Error: Inv... Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/unix.c b/src/common/unix.c index a87ce05ed..edca02abf 100644 --- a/src/common/unix.c +++ b/src/common/unix.c @@ -490,11 +490,6 @@ ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd) * message. */ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (!cmsg) { - fprintf(stderr, "Error: Invalid control message header\n"); - ret = -1; - goto end; - } if (cmsg->cmsg_level != SOL_SOCKET) { fprintf(stderr, "Error: The socket needs to be of type SOL_SOCKET\n"); ret = -1;