All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: Tetsuya Mukawa <mukawa@igel.co.jp>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Mcnamara, John" <john.mcnamara@intel.com>,
	michalx.k.jastrzebski@intel.com
Subject: Re: [PATCH] eal: Fix wrong resource release of pci_uio_unmap()
Date: Wed, 15 Jun 2016 17:01:00 +0200	[thread overview]
Message-ID: <CALwxeUvfxO_hpPcSF3FOsRQkbo_GD4ynA=Rggq6rxWE-ZZAKYQ@mail.gmail.com> (raw)
In-Reply-To: <1465961221-28357-1-git-send-email-mukawa@igel.co.jp>

On Wed, Jun 15, 2016 at 5:27 AM, Tetsuya Mukawa <mukawa@igel.co.jp> 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 <mukawa@igel.co.jp>

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

  reply	other threads:[~2016-06-15 15:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  3:26 [PATCH] eal: Fix wrong error checking of rte_eal_parse_devargs_str() Tetsuya Mukawa
2016-06-15 14:48 ` David Marchand
2016-06-16  2:03   ` Tetsuya Mukawa
2016-06-16  2:33 ` [PATCH v2] eal: Fix wrong error checking while parsing device arguments Tetsuya Mukawa
2016-06-15  3:26   ` [PATCH] eal: Fix resource leak of pci_uio_map_secondary() Tetsuya Mukawa
2016-06-15 14:45     ` David Marchand
2016-06-16  2:03       ` Tetsuya Mukawa
2016-06-16  2:33     ` [PATCH v2] eal: Fix resource leak while secondary process maps pci devices Tetsuya Mukawa
2016-06-17 12:28       ` David Marchand
2016-06-20  2:19         ` Tetsuya Mukawa
2016-06-20  8:50           ` Thomas Monjalon
2016-06-15  3:27   ` [PATCH] eal: Fix wrong resource release of pci_uio_unmap() Tetsuya Mukawa
2016-06-15 15:01     ` David Marchand [this message]
2016-06-16  2:33     ` [PATCH v2] eal: Fix wrong resource release while unmapping pci devices Tetsuya Mukawa
2016-06-17 12:12       ` David Marchand
2016-06-20  8:50         ` Thomas Monjalon
2016-06-17 12:10   ` [PATCH v2] eal: Fix wrong error checking while parsing device arguments David Marchand
2016-06-20  8:49     ` Thomas Monjalon

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='CALwxeUvfxO_hpPcSF3FOsRQkbo_GD4ynA=Rggq6rxWE-ZZAKYQ@mail.gmail.com' \
    --to=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=michalx.k.jastrzebski@intel.com \
    --cc=mukawa@igel.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.