DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ciara Power <ciara.power@intel.com>
To: bruce.richardson@intel.com
Cc: dev@dpdk.org, Ciara Power <ciara.power@intel.com>
Subject: [dpdk-dev] [PATCH 3/5] telemetry: fix closing socket fd on error
Date: Tue, 12 May 2020 16:29:00 +0100	[thread overview]
Message-ID: <20200512152902.70211-4-ciara.power@intel.com> (raw)
In-Reply-To: <20200512152902.70211-1-ciara.power@intel.com>

The socket fd is now being closed when the connection fails.

Coverity issue: 358444
Fixes: b80fe1805eee ("telemetry: introduce backward compatibility")
Cc: ciara.power@intel.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 lib/librte_telemetry/telemetry_legacy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_telemetry/telemetry_legacy.c b/lib/librte_telemetry/telemetry_legacy.c
index 10b575adfd..72471cbfbe 100644
--- a/lib/librte_telemetry/telemetry_legacy.c
+++ b/lib/librte_telemetry/telemetry_legacy.c
@@ -100,6 +100,7 @@ register_client(const char *cmd __rte_unused, const char *params,
 
 	if (connect(fd, (struct sockaddr *)&addrs, sizeof(addrs)) == -1) {
 		perror("\nClient connection error\n");
+		close(fd);
 		return -1;
 	}
 	pthread_create(&th, NULL, &legacy_client_handler,
-- 
2.17.1


  parent reply	other threads:[~2020-05-12 15:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 15:28 [dpdk-dev] [PATCH 0/5] small fixes for telemetry rework Ciara Power
2020-05-12 15:28 ` [dpdk-dev] [PATCH 1/5] telemetry: keep telemetry threads separate from data plane Ciara Power
2020-05-18 14:52   ` Laatz, Kevin
2020-05-12 15:28 ` [dpdk-dev] [PATCH 2/5] telemetry: fix error checking for strchr function Ciara Power
2020-05-18 14:52   ` Laatz, Kevin
2020-05-12 15:29 ` Ciara Power [this message]
2020-05-18 14:52   ` [dpdk-dev] [PATCH 3/5] telemetry: fix closing socket fd on error Laatz, Kevin
2020-05-12 15:29 ` [dpdk-dev] [PATCH 4/5] telemetry: fix checking error return for socket creation Ciara Power
2020-05-18 14:53   ` Laatz, Kevin
2020-05-12 15:29 ` [dpdk-dev] [PATCH 5/5] telemetry: fix buffer overrun if max bytes read Ciara Power
2020-05-18 14:53   ` Laatz, Kevin
2020-05-19 12:31 ` [dpdk-dev] [PATCH 0/5] small fixes for telemetry rework Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200512152902.70211-4-ciara.power@intel.com \
    --to=ciara.power@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).