From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 81DB5C37C for ; Tue, 30 Jun 2015 14:38:00 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 30 Jun 2015 05:33:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,377,1432623600"; d="scan'208";a="737655716" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga001.fm.intel.com with ESMTP; 30 Jun 2015 05:33:32 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.201]) by IRSMSX152.ger.corp.intel.com ([169.254.6.90]) with mapi id 14.03.0224.002; Tue, 30 Jun 2015 13:33:27 +0100 From: "Iremonger, Bernard" To: Tetsuya Mukawa , "dev@dpdk.org" Thread-Topic: [PATCH v7 03/12] eal: Fix memory leaks and needless increment of pci_map_addr Thread-Index: AQHQsw5XtXQCJuUMsk28AvU+CmCZrZ3E+1aA Date: Tue, 30 Jun 2015 12:33:27 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C204A434E0@IRSMSX108.ger.corp.intel.com> References: <1435306705-11645-4-git-send-email-mukawa@igel.co.jp> <1435652668-3380-1-git-send-email-mukawa@igel.co.jp> <1435652668-3380-4-git-send-email-mukawa@igel.co.jp> In-Reply-To: <1435652668-3380-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.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 03/12] 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: Tue, 30 Jun 2015 12:38:01 -0000 > -----Original Message----- > From: Tetsuya Mukawa [mailto:mukawa@igel.co.jp] > Sent: Tuesday, June 30, 2015 9:24 AM > To: dev@dpdk.org > Cc: Iremonger, Bernard; david.marchand@6wind.com; Richardson, Bruce; > Tetsuya.Mukawa > Subject: [PATCH v7 03/12] 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