Not closing the socket implies a resource leak.
Coverity issue: 336865
Fixes:
29a62d1476b6 ("net/nfp: add CPP bridge as service")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
if (ret < 0) {
RTE_LOG(ERR, PMD, "%s: bind error (%d). Service failed\n",
__func__, errno);
+ close(sockfd);
return ret;
}
if (ret < 0) {
RTE_LOG(ERR, PMD, "%s: listen error(%d). Service failed\n",
__func__, errno);
+ close(sockfd);
return ret;
}
RTE_LOG(ERR, PMD, "%s: accept call error (%d)\n",
__func__, errno);
RTE_LOG(ERR, PMD, "%s: service failed\n", __func__);
+ close(sockfd);
return -EIO;
}