From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by dpdk.org (Postfix) with ESMTP id 35B15C75A for ; Wed, 15 Jun 2016 17:01:20 +0200 (CEST) Received: by mail-lb0-f169.google.com with SMTP id o4so3112456lbp.2 for ; Wed, 15 Jun 2016 08:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=W0GaG9TT0Zb8lBzJYAZC2CgwrKpxtIlRsSGrfNnQ+TE=; b=I+pfndzphI0gEBXgnlEksbmPlzU8KDNnmZhSRIhjBSJQP2DELr/c8e7sb0h2EIDJ5b qR9m8N3KzZ1xClUamxwM/DYrJi4oGaHsX7N0FdKRW6XZ7bRtD4pLhwCJVmwaOcIb9iwX gHsZYuh5OGrSmCTCRYmDHxz6G5HwLxd2ndWtdYLYZAcMIurTVnuaPTZl3lM9a/s8+ALx UXV6/ASSfwpkNwqmVv3DaVXCkMU4OHbetyV9dU49C/BERIjpcMKTJ8TZf7FG2UIUXV1U 9re9fBgThPMp7KUoBh+YoiwcamBWRoj1EpcTGCF9PlDZz9oZdKmfX9ikdgmB612VVCrp K/0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=W0GaG9TT0Zb8lBzJYAZC2CgwrKpxtIlRsSGrfNnQ+TE=; b=e1VihoGZaeKe3snM2MX0NtuxUpBKxLbM9CQoFZ/8Xu8FD99ij7acFRzz+j3oZl52bC LDvebsotXgBpG1NUpyR3KW7Nt/nuf5qe7SgLo0zrOxS2VrnFT6yf8DlvpdEBH9LPLX+F QpgZ3deU3w7kbIB7xe/xjwVg8z87bjkj4+gh6/jWqFmiB4kDf1/Xno0VUa1KOINm96F3 3T9ZbNuqWmfzOnUlNGVKKt2gTwZJOsWogu6A7v5TQHuKKUZY86z+9oQKkcWDSWS98fmI b5phgwhrrDju4LnKEIRbn3W946RPcT1ogmjTrlZRXLMts1Magu4KM2NjvHn9b8+YFrIO E61w== X-Gm-Message-State: ALyK8tIz/Z34uusSk/8/mE5ea7/Zky1Fqi0VnWkzUAHbU3IYLrW8mjW3xoyOPXJ5hd12ATiDgd1XX3RnwGirjOjH X-Received: by 10.28.27.212 with SMTP id b203mr12098729wmb.19.1466002879740; Wed, 15 Jun 2016 08:01:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.16.13 with HTTP; Wed, 15 Jun 2016 08:01:00 -0700 (PDT) In-Reply-To: <1465961221-28357-1-git-send-email-mukawa@igel.co.jp> References: <1465961221-28357-1-git-send-email-mukawa@igel.co.jp> From: David Marchand Date: Wed, 15 Jun 2016 17:01:00 +0200 Message-ID: To: Tetsuya Mukawa Cc: "dev@dpdk.org" , "Mcnamara, John" , michalx.k.jastrzebski@intel.com Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH] eal: Fix wrong resource release of pci_uio_unmap() 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: Wed, 15 Jun 2016 15:01:20 -0000 On Wed, Jun 15, 2016 at 5:27 AM, Tetsuya Mukawa wrote: > The 'path' member of mapped_pci_resource structure is allocated by > primary process, but currenctly it will be freed by both primary > and secondary process. > The patch fixes to be freed by only primary process. > > Signed-off-by: Tetsuya Mukawa Function name in title. > --- > lib/librte_eal/common/eal_common_pci_uio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_pci_uio.c b/lib/librte_eal/common/eal_common_pci_uio.c > index e718643..b2c68f3 100644 > --- a/lib/librte_eal/common/eal_common_pci_uio.c > +++ b/lib/librte_eal/common/eal_common_pci_uio.c > @@ -162,7 +162,9 @@ pci_uio_unmap(struct mapped_pci_resource *uio_res) > for (i = 0; i != uio_res->nb_maps; i++) { > pci_unmap_resource(uio_res->maps[i].addr, > (size_t)uio_res->maps[i].size); > - rte_free(uio_res->maps[i].path); > + > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) > + rte_free(uio_res->maps[i].path); > } > } > The rest looks good to me. -- David Marchand