From: Wenjun Wu <wenjun1.wu@intel.com>
To: dev@dpdk.org, anatoly.burakov@intel.com, qi.z.zhang@intel.com
Cc: simei.su@intel.com, Wenjun Wu <wenjun1.wu@intel.com>, stable@dpdk.org
Subject: [PATCH v1 1/2] bus/vdev: fix memory leak
Date: Wed, 5 Jul 2023 17:25:10 +0800 [thread overview]
Message-ID: <20230705092511.362484-2-wenjun1.wu@intel.com> (raw)
In-Reply-To: <20230705092511.362484-1-wenjun1.wu@intel.com>
In hotplug usecase, devargs will be allocated in secondary process
in the function alloc_devargs. Since it will not be insert into the
devarg_list, it will have no chance to be freed.
This patch adds additional memory free for device structure member devargs
in the secondary process in rte_vdev_uninit.
Fixes: f5b2eff0847d ("bus/vdev: fix devargs after multi-process bus scan")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
drivers/bus/vdev/vdev.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 7974b27295..3f4e6a1b55 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -373,6 +373,11 @@ rte_vdev_uninit(const char *name)
TAILQ_REMOVE(&vdev_device_list, dev, next);
rte_devargs_remove(dev->device.devargs);
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+ dev->device.devargs != NULL) {
+ rte_devargs_reset(dev->device.devargs);
+ free(dev->device.devargs);
+ }
free(dev);
unlock:
--
2.34.1
next parent reply other threads:[~2023-07-05 9:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230705092511.362484-1-wenjun1.wu@intel.com>
2023-07-05 9:25 ` Wenjun Wu [this message]
2023-07-06 0:48 ` fengchengwen
2023-07-05 9:25 ` [PATCH v1 2/2] examples/multi_process: " Wenjun Wu
2023-07-06 1:02 ` fengchengwen
2023-07-06 5:10 ` Wu, Wenjun1
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=20230705092511.362484-2-wenjun1.wu@intel.com \
--to=wenjun1.wu@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=simei.su@intel.com \
--cc=stable@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).