From: Wei Dai Date: Thu, 17 Nov 2016 06:47:15 +0000 (+0800) Subject: pci: fix check of mknod X-Git-Tag: spdx-start~5305 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f1d54e6dfb1624d9c2d0a1b8a96eb4a84070b639;p=dpdk.git pci: fix check of mknod 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: f7f97c16048e ("pci: add option --create-uio-dev to run without hotplug") Signed-off-by: Wei Dai Acked-by: Olivier Matz --- diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c index 1786b754a2..3e4ffb57ee 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;