From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E10AE2BD4 for ; Thu, 21 Apr 2016 13:06:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 21 Apr 2016 04:06:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,512,1455004800"; d="scan'208";a="959730559" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by orsmga002.jf.intel.com with ESMTP; 21 Apr 2016 04:06:41 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX109.ger.corp.intel.com (163.33.3.23) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 21 Apr 2016 12:06:40 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.57]) by IRSMSX156.ger.corp.intel.com ([169.254.3.32]) with mapi id 14.03.0248.002; Thu, 21 Apr 2016 12:06:40 +0100 From: "Burakov, Anatoly" To: "Mrzyglod, DanielX T" CC: "dev@dpdk.org" Thread-Topic: [PATCH] eal: fix unchecked return value from library Thread-Index: AQHRm7w4RHmiHXYu0kaFg81pEBQtYp+URB8A Date: Thu, 21 Apr 2016 11:06:39 +0000 Message-ID: References: <1461239817-96357-1-git-send-email-danielx.t.mrzyglod@intel.com> In-Reply-To: <1461239817-96357-1-git-send-email-danielx.t.mrzyglod@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjk5MWMyOWYtMmJjMS00MzVjLWEwOGEtM2RhYTM2YTNjMmVlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImFhb0M5T0lxSHdZMHdTN1hISlpxNDBHb2lib0dDNjlMUkh5WlhXZFVmdFE9In0= x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] eal: fix unchecked return value from library 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: Thu, 21 Apr 2016 11:06:43 -0000 > Fix issue reported by Coverity. > Coverity ID 13194 >=20 > The function returns a value that indicates an error condition. If this = is not > checked, the error condition may not be handled correctly. >=20 > In pci_vfio_mp_sync_thread: Value returned from a library function is not > checked for errors before being used. This value may indicate an error > condition. >=20 > Fixes: 2f4adfad0a69 ("vfio: add multiprocess support") >=20 > Signed-off-by: Daniel Mrzyglod > --- > lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c > b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c > index d9188fd..2b136fc 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio_mp_sync.c > @@ -287,7 +287,10 @@ pci_vfio_mp_sync_thread(void __rte_unused * arg) > struct linger l; > l.l_onoff =3D 1; > l.l_linger =3D 60; > - setsockopt(conn_sock, SOL_SOCKET, SO_LINGER, &l, > sizeof(l)); > + > + if (setsockopt(conn_sock, SOL_SOCKET, SO_LINGER, &l, > sizeof(l)) < 0) > + RTE_LOG(ERR, EAL, "Cannot set SO_LINGER option " > + "on listen socket (%s)\n", > strerror(errno)); >=20 > ret =3D vfio_mp_sync_receive_request(conn_sock); >=20 > -- > 2.5.5 Acked-by: Anatoly Burakov