DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: David Marchand <david.marchand@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/7] pci: fix potential mem leak
Date: Thu, 1 May 2014 15:00:21 +0000	[thread overview]
Message-ID: <C6ECDF3AB251BE4894318F4E45123697592AAEE3@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <1398691187-4918-2-git-send-email-david.marchand@6wind.com>

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 <david.marchand@6wind.com>
> ---
>  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

 

  reply	other threads:[~2014-05-01 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28 13:19 [dpdk-dev] [PATCH 0/7] pci cleanup David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 1/7] pci: fix potential mem leak David Marchand
2014-05-01 15:00   ` Burakov, Anatoly [this message]
2014-05-05  8:14     ` David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 2/7] pci: align bsd implementation on linux David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 3/7] pci: remove virtio-uio workaround David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 4/7] pci: rework interrupt fd init and fix fd leak David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 5/7] pci: pci_switch_module cleanup David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 6/7] pci: move RTE_PCI_DRV_FORCE_UNBIND handling out of #ifdef David Marchand
2014-04-28 13:19 ` [dpdk-dev] [PATCH 7/7] pci: remove deprecated RTE_EAL_UNBIND_PORTS option David Marchand
2014-04-29  9:19 ` [dpdk-dev] [PATCH 0/7] pci cleanup Burakov, Anatoly
2014-04-29 11:00 ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C6ECDF3AB251BE4894318F4E45123697592AAEE3@IRSMSX101.ger.corp.intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).