DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harshad Narayane <harshad.suresh.narayane@intel.com>
To: dev@dpdk.org
Cc: Kamalakannan R <kamalakannan.r@intel.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH] net/softnic: fix file close
Date: Tue, 27 Sep 2022 00:42:09 -0400	[thread overview]
Message-ID: <20220927044209.367093-1-harshad.suresh.narayane@intel.com> (raw)

Coverity issue: 380976
Fixes: e3be2495 ("net/softnic: add pipeline code generation command")

Fix file close at pipeline code generation.

Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com>
Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 drivers/net/softnic/rte_eth_softnic_cli.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c
index 7891f2b24f..e46383352b 100644
--- a/drivers/net/softnic/rte_eth_softnic_cli.c
+++ b/drivers/net/softnic/rte_eth_softnic_cli.c
@@ -230,6 +230,7 @@ cmd_softnic_pipeline_codegen(struct pmd_internals *softnic __rte_unused,
 	code_file = fopen(tokens[3], "w");
 	if (!code_file) {
 		snprintf(out, out_size, "Cannot open file %s.\n", tokens[3]);
+		fclose(spec_file);
 		return;
 	}
 
-- 
2.25.1


             reply	other threads:[~2022-09-27  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27  4:42 Harshad Narayane [this message]
2022-10-03 23:26 ` Ferruh Yigit

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=20220927044209.367093-1-harshad.suresh.narayane@intel.com \
    --to=harshad.suresh.narayane@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=kamalakannan.r@intel.com \
    /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).