From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A2BDF106A for ; Wed, 16 Nov 2016 03:43:36 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 15 Nov 2016 18:43:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,497,1473145200"; d="scan'208";a="1085805024" Received: from dpdk2.bj.intel.com ([172.16.182.65]) by fmsmga002.fm.intel.com with ESMTP; 15 Nov 2016 18:43:33 -0800 From: Wei Dai To: dev@dpdk.org, anatoly.burakov@intel.com, david.marchand@6wind.com, wei.dai@intel.com Date: Wed, 16 Nov 2016 10:40:47 +0800 Message-Id: <1479264047-67966-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1479262339-63608-1-git-send-email-zhiyong.yang@intel.com> References: <1479262339-63608-1-git-send-email-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH v2] eal/linuxapp: fix return value check of mknod() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 02:43:37 -0000 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 --- fix my local git setting and send same patch again to make merging easier 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