From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id 57260C3D4 for ; Thu, 16 Jun 2016 04:03:48 +0200 (CEST) Received: by mail-pa0-f47.google.com with SMTP id hl6so12900745pac.2 for ; Wed, 15 Jun 2016 19:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=VZSUxMWPz6QehbblPKCXDTxYmEIrJajSV+vSvIFC22E=; b=0w/DFXenh2IBXEwQnQKfW6uuKUNoNhtif/YpdFmnfHl8idmhIXY9FcVrofXEUIkdoG tD2IDweV0cKTOQS9QpHWKJc0BlGiLBlIcUqJ8JSs5vTPBfmBw46OhB8V5tBnkkbshOd/ DsuBK9phIEHF43Ue74HSB4DloKkEQQQErwPa2MgsJZVPCH4aViwIvnXqDOFLYNJsHW/X T7O/Y8ZuqE76a6rCs+DiLejqec7SNwbcpCCHaujpA7z0xLCflmalOWEQHT9RHTqb0OuK uN2QfbyuyPrcgNNmCrXETX6i6yUh86HHsGe4Q/lPelPgaBwVHbB8WujmBTBzqab/nayJ cA7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=VZSUxMWPz6QehbblPKCXDTxYmEIrJajSV+vSvIFC22E=; b=Zk/eHTHD9JnlavwzF3KfadhWZeyLqw06B/buyYNyIUWl2HlWXGrccUfPePZpzuXwej GQ5Y8J/PnWdQnKoRcsraw8r9/dW98QXb0DBC42zgiF97fuhR79kZqNQQVBjcam8sMaMp 7vS1ICs+cPaFbBD+M4wTiETWWzEGOUKhXG8O0VC1W1kcGeQ7NxmxqpW2lMMcchqIqqvl 5mEEuHU+3RdYifVtG+xwazeDAp8JmtbmrSLShYGLlEUJTm69mNR7uVN3V2vIL1uvbRZE qaxBC3F3slI9G125RbwDPQr9lHsW9IYPeqpfpsUBNObb7YqVR5OY9vxXq1x5k1b4FIB7 FHig== X-Gm-Message-State: ALyK8tIwjfy/LfCJJZIDknPMwrnlcBjC9r5X8hwfV770eUvj9+52CO+jYu+Ee1HsO+xVuw== X-Received: by 10.66.182.194 with SMTP id eg2mr2081724pac.159.1466042627453; Wed, 15 Jun 2016 19:03:47 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id h6sm43512530pac.46.2016.06.15.19.03.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2016 19:03:46 -0700 (PDT) To: David Marchand References: <1465961172-28253-1-git-send-email-mukawa@igel.co.jp> Cc: "dev@dpdk.org" , "Mcnamara, John" , michalx.k.jastrzebski@intel.com From: Tetsuya Mukawa Message-ID: Date: Thu, 16 Jun 2016 11:03:44 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: Fix resource leak of pci_uio_map_secondary() 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, 16 Jun 2016 02:03:48 -0000 On 2016/06/15 23:45, David Marchand wrote: > Hello Tetsuya, > > On Wed, Jun 15, 2016 at 5:26 AM, Tetsuya Mukawa wrote: >> If pci_map_resource() succeeds but mapped address is different from an >> address primary process mapped, this should be error. >> Then the address secondary process mapped should be freed. >> >> Signed-off-by: Tetsuya Mukawa > > The title should not contain the function name. Hi David, Thanks, I will change the title of all patches. > > >> --- >> lib/librte_eal/common/eal_common_pci_uio.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/lib/librte_eal/common/eal_common_pci_uio.c b/lib/librte_eal/common/eal_common_pci_uio.c >> index f062e81..e718643 100644 >> --- a/lib/librte_eal/common/eal_common_pci_uio.c >> +++ b/lib/librte_eal/common/eal_common_pci_uio.c >> @@ -85,6 +85,9 @@ pci_uio_map_secondary(struct rte_pci_device *dev) >> "Cannot mmap device resource file %s to address: %p\n", >> uio_res->maps[i].path, >> uio_res->maps[i].addr); >> + if (mapaddr != MAP_FAILED) >> + pci_unmap_resource(mapaddr, >> + (size_t)uio_res->maps[i].size); >> return -1; >> } >> } > > What of the previous mappings that might have succeeded earlier in this loop ? I will unmap all addresses mapped before. Thanks, Tetsuya