From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id DFEA91B10C; Wed, 17 Apr 2019 09:17:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2019 00:17:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,361,1549958400"; d="scan'208";a="141349234" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 17 Apr 2019 00:17:58 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 17 Apr 2019 00:17:58 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 17 Apr 2019 00:17:58 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.25]) by shsmsx102.ccr.corp.intel.com ([169.254.2.206]) with mapi id 14.03.0415.000; Wed, 17 Apr 2019 15:17:56 +0800 From: "Pei, Andy" To: "Xu, Rosen" , "dev@dpdk.org" CC: "Kovacevic, Marko" , "liq3ea@163.com" , "stable@dpdk.org" Thread-Topic: [PATCH] raw/ifpga: fix fd leak in rte fpga do pr Thread-Index: AQHU9Oq+wlmbUP2FZE68U7uCjJsls6Y/amMAgACHF8A= Date: Wed, 17 Apr 2019 07:17:54 +0000 Message-ID: <5941F446C088714A85408FA3132CFCBB010091CC@SHSMSX105.ccr.corp.intel.com> References: <1555483757-48188-1-git-send-email-andy.pei@intel.com> <0E78D399C70DA940A335608C6ED296D73A6B81CB@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <0E78D399C70DA940A335608C6ED296D73A6B81CB@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGIxN2FlZjYtZTYwYS00YWYzLWEwZDYtNTQ3OGQ4ZjY0NGI2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQWtiRXdLa1g4bWNnc1dNaGlTQVNIdU1CNlM0NEFvV2RHVGJxeTk2bzRhK2d1cTNRZytuazd2ZCtTM0NjY1N1WSJ9 dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action 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] raw/ifpga: fix fd leak in rte fpga do pr X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2019 07:18:00 -0000 Okay -----Original Message----- From: Xu, Rosen=20 Sent: Wednesday, April 17, 2019 3:14 PM To: Pei, Andy ; dev@dpdk.org Cc: Kovacevic, Marko ; liq3ea@163.com; stable@dp= dk.org Subject: RE: [PATCH] raw/ifpga: fix fd leak in rte fpga do pr Hi, > -----Original Message----- > From: Pei, Andy > Sent: Wednesday, April 17, 2019 14:49 > To: dev@dpdk.org > Cc: Pei, Andy ; Xu, Rosen ;=20 > Kovacevic, Marko ; liq3ea@163.com;=20 > stable@dpdk.org > Subject: [PATCH] raw/ifpga: fix fd leak in rte fpga do pr Pls use raw/ifpga_rawdev prefix. I suggest you to run ./devtools/check-git-log.sh -1 before you sending patc= h. > In rte_fpga_do_pr() function, if 'stat' returns error, > rte_fpga_do_pr() returns -EINVAL without closing the 'file_fd' that=20 > has been opened. > After this patch, 'file_fd' is closed before rte_fpga_do_pr() returns=20 > -EINVAL when 'stat' returns error Pls put this in the commit message: Coverity issue: 279441 =20 > Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver") > Cc: rosen.xu@intel.com > Cc: marko.kovacevic@intel.com > Cc: liq3ea@163.com > Cc: andy.pei@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Andy Pei > --- > --- > drivers/raw/ifpga_rawdev/ifpga_rawdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > index da772d0..eff001b 100644 > --- a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > +++ b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > @@ -244,7 +244,8 @@ > if (ret) { > IFPGA_RAWDEV_PMD_ERR("stat on bitstream file > failed: %s\n", > file_name); > - return -EINVAL; > + ret =3D -EINVAL; > + goto close_fd; > } > buffer_size =3D file_stat.st_size; > IFPGA_RAWDEV_PMD_INFO("bitstream file size: %zu\n", buffer_size); > -- > 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 34CC8A00E6 for ; Wed, 17 Apr 2019 09:18:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 087D81B11F; Wed, 17 Apr 2019 09:18:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id DFEA91B10C; Wed, 17 Apr 2019 09:17:59 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2019 00:17:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,361,1549958400"; d="scan'208";a="141349234" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 17 Apr 2019 00:17:58 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 17 Apr 2019 00:17:58 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 17 Apr 2019 00:17:58 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.25]) by shsmsx102.ccr.corp.intel.com ([169.254.2.206]) with mapi id 14.03.0415.000; Wed, 17 Apr 2019 15:17:56 +0800 From: "Pei, Andy" To: "Xu, Rosen" , "dev@dpdk.org" CC: "Kovacevic, Marko" , "liq3ea@163.com" , "stable@dpdk.org" Thread-Topic: [PATCH] raw/ifpga: fix fd leak in rte fpga do pr Thread-Index: AQHU9Oq+wlmbUP2FZE68U7uCjJsls6Y/amMAgACHF8A= Date: Wed, 17 Apr 2019 07:17:54 +0000 Message-ID: <5941F446C088714A85408FA3132CFCBB010091CC@SHSMSX105.ccr.corp.intel.com> References: <1555483757-48188-1-git-send-email-andy.pei@intel.com> <0E78D399C70DA940A335608C6ED296D73A6B81CB@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <0E78D399C70DA940A335608C6ED296D73A6B81CB@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGIxN2FlZjYtZTYwYS00YWYzLWEwZDYtNTQ3OGQ4ZjY0NGI2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQWtiRXdLa1g4bWNnc1dNaGlTQVNIdU1CNlM0NEFvV2RHVGJxeTk2bzRhK2d1cTNRZytuazd2ZCtTM0NjY1N1WSJ9 dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] raw/ifpga: fix fd leak in rte fpga do pr X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190417071754.iyPPeTnHG2rck4GwKTrx0eeLVgS1QTLzPHjX6JFuX1k@z> Okay -----Original Message----- From: Xu, Rosen=20 Sent: Wednesday, April 17, 2019 3:14 PM To: Pei, Andy ; dev@dpdk.org Cc: Kovacevic, Marko ; liq3ea@163.com; stable@dp= dk.org Subject: RE: [PATCH] raw/ifpga: fix fd leak in rte fpga do pr Hi, > -----Original Message----- > From: Pei, Andy > Sent: Wednesday, April 17, 2019 14:49 > To: dev@dpdk.org > Cc: Pei, Andy ; Xu, Rosen ;=20 > Kovacevic, Marko ; liq3ea@163.com;=20 > stable@dpdk.org > Subject: [PATCH] raw/ifpga: fix fd leak in rte fpga do pr Pls use raw/ifpga_rawdev prefix. I suggest you to run ./devtools/check-git-log.sh -1 before you sending patc= h. > In rte_fpga_do_pr() function, if 'stat' returns error, > rte_fpga_do_pr() returns -EINVAL without closing the 'file_fd' that=20 > has been opened. > After this patch, 'file_fd' is closed before rte_fpga_do_pr() returns=20 > -EINVAL when 'stat' returns error Pls put this in the commit message: Coverity issue: 279441 =20 > Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver") > Cc: rosen.xu@intel.com > Cc: marko.kovacevic@intel.com > Cc: liq3ea@163.com > Cc: andy.pei@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Andy Pei > --- > --- > drivers/raw/ifpga_rawdev/ifpga_rawdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > index da772d0..eff001b 100644 > --- a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > +++ b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c > @@ -244,7 +244,8 @@ > if (ret) { > IFPGA_RAWDEV_PMD_ERR("stat on bitstream file > failed: %s\n", > file_name); > - return -EINVAL; > + ret =3D -EINVAL; > + goto close_fd; > } > buffer_size =3D file_stat.st_size; > IFPGA_RAWDEV_PMD_INFO("bitstream file size: %zu\n", buffer_size); > -- > 1.8.3.1