DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/raw/ifpga_rawdev: fix coverity issue 323508
@ 2018-10-23  1:50 Rosen Xu
  2018-10-23  6:59 ` Shreyansh Jain
  2018-10-23  7:09 ` Shreyansh Jain
  0 siblings, 2 replies; 8+ messages in thread
From: Rosen Xu @ 2018-10-23  1:50 UTC (permalink / raw)
  To: dev; +Cc: tianfei.zhang, shreyansh.jain, hemant.agrawal, rosen.xu, ferruh.yigit

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-10-25 12:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-23  1:50 [dpdk-dev] [PATCH] drivers/raw/ifpga_rawdev: fix coverity issue 323508 Rosen Xu
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

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).