From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f176.google.com (mail-ob0-f176.google.com [209.85.214.176]) by dpdk.org (Postfix) with ESMTP id F344F5925 for ; Mon, 5 May 2014 10:14:17 +0200 (CEST) Received: by mail-ob0-f176.google.com with SMTP id wp4so7993057obc.21 for ; Mon, 05 May 2014 01:14:22 -0700 (PDT) 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:date :message-id:subject:from:to:cc:content-type; bh=/wI2L0Wm3UMP777kcThWfGe9pwv1WFzXT9U9y36HpxY=; b=i5zhlghY8DB3OytdvPw/kHnabCJY1crjUh8U/dLqFsZGXFt5VaNlEVFX4Gobrshzpl nBRrQqGQUecAHJQ6kX+61MkZggQJkTDgHyNhgIhvfz4T49OPqS1QGwB4Yv4qub/PqCbY kljk1G7O4ym+2JcACo5lcwintlMR1ZVNhHwvab8Z7ACRsheTl8OKHIBbn5ZX4C+M1uaG JxS0QIYBQk08Foi3dpUbYNT1tKfK5vz8NPJXczo9Xrd1RuETKx1QPvCFqHd2bAwg1WgI U1LedTzI4EPMlNQKNyOTnWOZfjEdDo4Cba+Rd5PXPAO8Cm9L04tKcI/veGNOn5enEglO GcPQ== X-Gm-Message-State: ALoCoQnLQCSuWtuQCUnaykPifmuZtliOP/oTGwmUyQLtOfo/gXcDIqXaYPsoMM+o1xY2xkDHa1PK MIME-Version: 1.0 X-Received: by 10.182.74.234 with SMTP id x10mr29763419obv.1.1399277662815; Mon, 05 May 2014 01:14:22 -0700 (PDT) Received: by 10.76.79.36 with HTTP; Mon, 5 May 2014 01:14:22 -0700 (PDT) In-Reply-To: References: <1398691187-4918-1-git-send-email-david.marchand@6wind.com> <1398691187-4918-2-git-send-email-david.marchand@6wind.com> Date: Mon, 5 May 2014 10:14:22 +0200 Message-ID: From: David Marchand To: "Burakov, Anatoly" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/7] pci: fix potential mem leak 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: Mon, 05 May 2014 08:14:18 -0000 Hello Anatoly, Oh yes, missed this one. Ok, I will resubmit an updated patch. Thanks. -- David Marchand On Thu, May 1, 2014 at 5:00 PM, Burakov, Anatoly wrote: > Hi David, > > > Looking at bsd implementation, we can see that there is a potential mem > > leak in linux implementation. Fix this. > > > > Signed-off-by: David Marchand > > --- > > lib/librte_eal/linuxapp/eal/eal_pci.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c > > b/lib/librte_eal/linuxapp/eal/eal_pci.c > > index 9538efe..313bab7 100644 > > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > > @@ -678,6 +678,7 @@ pci_uio_map_resource(struct rte_pci_device *dev) > > (mapaddr = pci_map_resource(dev, > > NULL, devname, (off_t)offset, > > (size_t)maps[j].size)) == NULL) { > > + rte_free(uio_res); > > return (-1); > > } > > > > -- > > 1.7.10.4 > > Actually, there's another possible mem leak, right after uio_res = > rte_zmalloc(): > > /* collect info about device mappings */ > if ((nb_maps = pci_uio_get_mappings(dirname, uio_res->maps, > sizeof (uio_res->maps) / sizeof > (uio_res->maps[0]))) > < 0) > return (nb_maps); > > Best regards, > Anatoly Burakov > DPDK SW Engineer > > -------------------------------------------------------------- > Intel Shannon Limited > Registered in Ireland > Registered Office: Collinstown Industrial Park, Leixlip, County Kildare > Registered Number: 308263 > Business address: Dromore House, East Park, Shannon, Co. Clare > > >