From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id C1BC6C4B6 for ; Fri, 26 Jun 2015 16:34:51 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 26 Jun 2015 07:34:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,685,1427785200"; d="scan'208";a="514688546" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by FMSMGA003.fm.intel.com with ESMTP; 26 Jun 2015 07:34:51 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.201]) by IRSMSX104.ger.corp.intel.com ([169.254.5.171]) with mapi id 14.03.0224.002; Fri, 26 Jun 2015 15:34:49 +0100 From: "Iremonger, Bernard" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [PATCH v6 3/5] eal: Fix memory leaks and needless increment of pci_map_addr Thread-Index: AQHQr+jE+1YjUGrWJkucxPRqHF54/Z2+2lLw Date: Fri, 26 Jun 2015 14:34:48 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C204A42434@IRSMSX108.ger.corp.intel.com> References: <1435202367-8887-4-git-send-email-mukawa@igel.co.jp> <1435306705-11645-1-git-send-email-mukawa@igel.co.jp> <1435306705-11645-4-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1435306705-11645-4-git-send-email-mukawa@igel.co.jp> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v6 3/5] eal: Fix memory leaks and needless increment of pci_map_addr 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: Fri, 26 Jun 2015 14:34:52 -0000 > -----Original Message----- > From: Tetsuya Mukawa [mailto:mukawa@igel.co.jp] > Sent: Friday, June 26, 2015 9:18 AM > To: dev@dpdk.org > Cc: Iremonger, Bernard; david.marchand@6wind.com; Tetsuya.Mukawa > Subject: [PATCH v6 3/5] eal: Fix memory leaks and needless increment of > pci_map_addr >=20 > From: "Tetsuya.Mukawa" >=20 > This patch fixes following memory leaks. > - When open() is failed, uio_res and fds won't be freed in > pci_uio_map_resource(). > - When pci_map_resource() is failed but path is allocated correctly, > path and fds won't be freed in pci_uio_map_recource(). > Also, some mapped resources should be freed. > - When pci_uio_unmap() is called, path should be freed. >=20 > Also, fixes below. > - When pci_map_resource() is failed, mapaddr will be MAP_FAILED. > In this case, pci_map_addr should not be incremented in > pci_uio_map_resource(). > - To shrink code, move close(). > - Remove fail variable. >=20 > Signed-off-by: Tetsuya Mukawa Acked-by: Bernard Iremonger