DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: wangyunjian <wangyunjian@huawei.com>, dev@dpdk.org
Cc: g.singh@nxp.com, akhil.goyal@nxp.com, jerry.lilijun@huawei.com,
	xudingke@huawei.com, stable@dpdk.org,
	Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [dpdk-dev] [PATCH v1] net/pfe: fix to set mac_addrs to NULL after freeing
Date: Wed, 8 Apr 2020 15:27:31 +0100	[thread overview]
Message-ID: <8e8d6a3b-c0b7-dfa2-35f9-ae09c8bbdeb3@intel.com> (raw)
In-Reply-To: <1586259551-19324-1-git-send-email-wangyunjian@huawei.com>

On 4/7/2020 12:39 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> It does not correctly set the mac_addrs variable to NULL after
> freeing it, which will lead to a double free.
> 
> Fixes: 67fc3ff97c39 ("net/pfe: introduce basic functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  drivers/net/pfe/pfe_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
> index 940347819..ba0f8dd3f 100644
> --- a/drivers/net/pfe/pfe_ethdev.c
> +++ b/drivers/net/pfe/pfe_ethdev.c
> @@ -397,6 +397,7 @@ pfe_eth_exit(struct rte_eth_dev *dev, struct pfe *pfe)
>  	pfe_eth_close_cdev(dev->data->dev_private);
>  
>  	rte_free(dev->data->mac_addrs);
> +	dev->data->mac_addrs = NULL;

Why not remove 'rte_free(dev->data->mac_addrs);', since
'rte_eth_dev_release_port()' does free the 'mac_addrs'?

>  	rte_eth_dev_release_port(dev);
>  	pfe->nb_devs--;
>  }
> 


  reply	other threads:[~2020-04-08 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 11:39 wangyunjian
2020-04-08 14:27 ` Ferruh Yigit [this message]
2020-04-09  1:12   ` wangyunjian

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=8e8d6a3b-c0b7-dfa2-35f9-ae09c8bbdeb3@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    --cc=xudingke@huawei.com \
    /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).