DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: wangyunjian <wangyunjian@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "ciara.loftus@intel.com" <ciara.loftus@intel.com>,
	"qi.z.zhang@intel.com" <qi.z.zhang@intel.com>,
	xudingke <xudingke@huawei.com>,
	"Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: fix memzone leak in error path
Date: Tue, 5 Dec 2023 09:41:41 +0000	[thread overview]
Message-ID: <746decf7-616f-4158-86f9-bc45425c46a1@amd.com> (raw)
In-Reply-To: <747e0b0425ca4699904352d047048190@huawei.com>

On 12/5/2023 1:23 AM, wangyunjian wrote:
> 
> 
>> -----Original Message-----
>> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
>> Sent: Monday, December 4, 2023 10:10 PM
>> To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org
>> Cc: ciara.loftus@intel.com; qi.z.zhang@intel.com; xudingke
>> <xudingke@huawei.com>; Lilijun (Jerry) <jerry.lilijun@huawei.com>;
>> stable@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] net/af_xdp: fix memzone leak in error path
>>
>> On 12/1/2023 8:03 AM, Yunjian Wang wrote:
>>> In xdp_umem_configure() allocated memzone for the 'umem', we should
>>> free it when xsk_umem__create() call fails, otherwise it will lead to
>>> memory zone leak.
>>>
>>> Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
>>> ---
>>>  drivers/net/af_xdp/rte_eth_af_xdp.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c
>>> b/drivers/net/af_xdp/rte_eth_af_xdp.c
>>> index 2a20a6960c..2a1fdafb3c 100644
>>> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
>>> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
>>> @@ -1229,6 +1229,7 @@ xsk_umem_info *xdp_umem_configure(struct
>>> pmd_internals *internals,
>>>
>>>  	if (ret) {
>>>  		AF_XDP_LOG(ERR, "Failed to create umem\n");
>>> +		rte_memzone_free(mz);
>>>
>>
>> Doesn't 'xdp_umem_destroy()', in the label 'err', already free it?
> 
> In this case, 'mz' is not assigned to 'umem->mz'. Therefore,
> the'xdp_umem_destroy()' does not free 'mz'.
> 
> 

True.
What do you think to move 'umem->mz = mz;' assignment after 'mz == NULL'
check? So related code can be grouped together.





  reply	other threads:[~2023-12-05  9:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  8:03 Yunjian Wang
2023-12-04 14:09 ` Ferruh Yigit
2023-12-05  1:23   ` wangyunjian
2023-12-05  9:41     ` Ferruh Yigit [this message]
2023-12-05 12:31       ` wangyunjian
2023-12-05 12:23 ` [PATCH v2] " Yunjian Wang
2023-12-05 13:16   ` Loftus, Ciara
2023-12-06 12:29     ` Ferruh Yigit

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=746decf7-616f-4158-86f9-bc45425c46a1@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerry.lilijun@huawei.com \
    --cc=qi.z.zhang@intel.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).