DPDK patches and discussions
 help / color / mirror / Atom feed
From: John Miller <john.miller@atomicrules.com>
To: dev@dpdk.org
Cc: ed.czeck@atomicrules.com, shepard.siegel@atomicrules.com,
	John Miller <john.miller@atomicrules.com>
Subject: [dpdk-dev] [PATCH 4/4] net/ark: fix return value of null not checked
Date: Tue, 16 May 2017 12:14:18 -0400	[thread overview]
Message-ID: <1494951258-11232-4-git-send-email-john.miller@atomicrules.com> (raw)
In-Reply-To: <1494951258-11232-1-git-send-email-john.miller@atomicrules.com>

Coverity issue: 144517
Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: John Miller <john.miller@atomicrules.com>
---
 drivers/net/ark/ark_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index f8fb359..017817e 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -899,6 +899,12 @@ static void eth_ark_macaddr_remove(struct rte_eth_dev *dev,
 	int  size = 0;
 	int first = 1;
 
+	if (file == NULL) {
+		PMD_DRV_LOG(ERR, "Unable to open "
+			    "config file %s\n", value);
+		return -1;
+	}
+
 	while (fgets(line, sizeof(line), file)) {
 		size += strlen(line);
 		if (size >= ARK_MAX_ARG_LEN) {
-- 
1.9.1

  parent reply	other threads:[~2017-05-16 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 16:14 [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 2/4] net/ark: fix return code not checked John Miller
2017-05-16 16:14 ` [dpdk-dev] [PATCH 3/4] net/ark: fix null pointer dereference John Miller
2017-05-16 16:14 ` John Miller [this message]
2017-05-16 16:37 ` [dpdk-dev] [PATCH 1/4] net/ark: fix for buffer not null terminated 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=1494951258-11232-4-git-send-email-john.miller@atomicrules.com \
    --to=john.miller@atomicrules.com \
    --cc=dev@dpdk.org \
    --cc=ed.czeck@atomicrules.com \
    --cc=shepard.siegel@atomicrules.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).