From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 726D43977 for ; Wed, 16 Nov 2016 04:28:23 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP; 15 Nov 2016 19:28:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,646,1473145200"; d="scan'208";a="31395017" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 15 Nov 2016 19:28:19 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 15 Nov 2016 19:28:09 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 15 Nov 2016 19:28:09 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.138]) with mapi id 14.03.0248.002; Wed, 16 Nov 2016 11:28:07 +0800 From: "Lu, Wenzhuo" To: "Dai, Wei" , "dev@dpdk.org" , "Burakov, Anatoly" , "david.marchand@6wind.com" , "Dai, Wei" Thread-Topic: [dpdk-dev] [PATCH v2] eal/linuxapp: fix return value check of mknod() Thread-Index: AQHSP7NRgTrI6eyB7UugtTQKbGAjI6Da806g Date: Wed, 16 Nov 2016 03:28:06 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093935007B@shsmsx102.ccr.corp.intel.com> References: <1479262339-63608-1-git-send-email-zhiyong.yang@intel.com> <1479264047-67966-1-git-send-email-wei.dai@intel.com> In-Reply-To: <1479264047-67966-1-git-send-email-wei.dai@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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 03:28:24 -0000 Hi Wei, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Dai > Sent: Wednesday, November 16, 2016 10:41 AM > To: dev@dpdk.org; Burakov, Anatoly; david.marchand@6wind.com; Dai, Wei > Subject: [dpdk-dev] [PATCH v2] eal/linuxapp: fix return value check of mk= nod() >=20 > 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(). >=20 > Fixes: 67c536bdad93 ("pci: move uio mapping in a dedicated file") >=20 > Signed-off-by: Wei Dai > --- > fix my local git setting and send same patch again to make merging easier >=20 > lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 =3D makedev(major, minor); > ret =3D mknod(filename, S_IFCHR | S_IRUSR | S_IWUSR, dev); > - if (f =3D=3D NULL) { > + if (ret !=3D 0) { I think checkpatch will suggest to just use if (ret)