DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal/linuxapp: fix return value check of mknod()
@ 2016-11-16  2:12 Zhiyong Yang
  2016-11-16  2:40 ` [dpdk-dev] [PATCH v2] " Wei Dai
  0 siblings, 1 reply; 10+ messages in thread
From: Zhiyong Yang @ 2016-11-16  2:12 UTC (permalink / raw)
  To: dev, anatoly.burakov, david.marchand; +Cc: Wei Dai

From: Wei Dai <wei.dai@intel.com>

In function pci_mknod_uio_dev() in lib/librte_eal/eal/eal_pci_uio.c,
The return value of mknod() is ret, not f got by fopen().
So the value of ret should be checked for mknod().

Fixes: 67c536bdad93 ("pci: move uio mapping in a dedicated file")

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index 1786b75..3e4ffb5 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@ -133,7 +133,7 @@ pci_mknod_uio_dev(const char *sysfs_uio_path, unsigned uio_num)
 	snprintf(filename, sizeof(filename), "/dev/uio%u", uio_num);
 	dev = makedev(major, minor);
 	ret = mknod(filename, S_IFCHR | S_IRUSR | S_IWUSR, dev);
-	if (f == NULL) {
+	if (ret != 0) {
 		RTE_LOG(ERR, EAL, "%s(): mknod() failed %s\n",
 			__func__, strerror(errno));
 		return -1;
-- 
2.5.5

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

end of thread, other threads:[~2016-12-06 11:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16  2:12 [dpdk-dev] [PATCH] eal/linuxapp: fix return value check of mknod() Zhiyong Yang
2016-11-16  2:40 ` [dpdk-dev] [PATCH v2] " Wei Dai
2016-11-16  3:28   ` Lu, Wenzhuo
2016-11-16 11:04     ` Ferruh Yigit
2016-11-16 15:17       ` Dai, Wei
2016-11-16 11:23   ` David Marchand
2016-11-16 15:18     ` Dai, Wei
2016-11-17  6:47   ` [dpdk-dev] [PATCH v3] " Wei Dai
2016-12-06 10:44     ` Olivier Matz
2016-12-06 11:01       ` Thomas Monjalon

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