From: Steven Luong Date: Tue, 5 Mar 2019 23:42:21 +0000 (-0800) Subject: ip: coverity woes X-Git-Tag: v19.04-rc1~319 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F18043%2F2;p=vpp.git ip: coverity woes coverity complains about logically dead code for the statement if (error) because error was assigned to 0 prior to the check. I believe error was meant to get the return status of the call vnet_punt_socket_add. Change-Id: I794167493f63cb898d3618c2c28817823f46b765 Signed-off-by: Steven Luong --- diff --git a/src/vnet/ip/punt_api.c b/src/vnet/ip/punt_api.c index 3ca9621a410..ecb461bcdda 100644 --- a/src/vnet/ip/punt_api.c +++ b/src/vnet/ip/punt_api.c @@ -80,10 +80,10 @@ vl_api_punt_socket_register_t_handler (vl_api_punt_socket_register_t * mp) clib_error_t *error; vl_api_registration_t *reg; - error = 0; - vnet_punt_socket_add (vm, ntohl (mp->header_version), - mp->punt.ipv, mp->punt.l4_protocol, - ntohs (mp->punt.l4_port), (char *) mp->pathname); + error = vnet_punt_socket_add (vm, ntohl (mp->header_version), + mp->punt.ipv, mp->punt.l4_protocol, + ntohs (mp->punt.l4_port), + (char *) mp->pathname); if (error) { rv = -1;