DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rosen Xu <rosen.xu@intel.com>
To: dev@dpdk.org
Cc: tianfei.zhang@intel.com, shreyansh.jain@nxp.com,
	hemant.agrawal@nxp.com, rosen.xu@intel.com,
	ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH] drivers/raw/ifpga_rawdev: fix coverity issue 323508
Date: Tue, 23 Oct 2018 09:50:49 +0800	[thread overview]
Message-ID: <1540259449-135300-1-git-send-email-rosen.xu@intel.com> (raw)

This patch fixes rte_eal_hotplug_add without checking return value issue

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver")
Cc: rosen.xu@intel.com
---
 drivers/raw/ifpga_rawdev/ifpga_rawdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
index 3fed057..32e318f 100644
--- a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
+++ b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
@@ -542,6 +542,7 @@
 	int port;
 	char *name = NULL;
 	char dev_name[RTE_RAWDEV_NAME_MAX_LEN];
+	int ret = -1;
 
 	devargs = dev->device.devargs;
 
@@ -583,7 +584,7 @@
 	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
 	port, name);
 
-	rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
+	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
 			dev_name, devargs->args);
 end:
 	if (kvlist)
@@ -591,7 +592,7 @@
 	if (name)
 		free(name);
 
-	return 0;
+	return ret;
 }
 
 static int
-- 
1.8.3.1

             reply	other threads:[~2018-10-23  1:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  1:50 Rosen Xu [this message]
2018-10-23  6:59 ` Shreyansh Jain
2018-10-23  7:09 ` Shreyansh Jain
2018-10-23  9:51   ` Ferruh Yigit
2018-10-23 10:43     ` Shreyansh Jain
2018-10-23 12:14       ` Ferruh Yigit
2018-10-25 10:25   ` Ferruh Yigit
2018-10-25 12:49     ` Xu, Rosen

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=1540259449-135300-1-git-send-email-rosen.xu@intel.com \
    --to=rosen.xu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=tianfei.zhang@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).