From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>, Tomasz Duszynski <tduszynski@marvell.com>
Cc: <jerinj@marvell.com>, <thomas@monjalon.net>
Subject: [PATCH] bus/platform: fix use after free
Date: Thu, 24 Aug 2023 12:52:25 +0200 [thread overview]
Message-ID: <20230824105225.822297-1-tduszynski@marvell.com> (raw)
Remove device from the list before doing actual cleanup to avoid use
after free.
Bugzilla ID: 1276
Fixes: 17c839f74da3 ("bus: add platform bus")
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
drivers/bus/platform/platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/platform/platform.c b/drivers/bus/platform/platform.c
index 9b6ed2832e..7e24bb96a1 100644
--- a/drivers/bus/platform/platform.c
+++ b/drivers/bus/platform/platform.c
@@ -617,8 +617,8 @@ platform_bus_cleanup(void)
struct rte_platform_device *pdev, *tmp;
RTE_TAILQ_FOREACH_SAFE(pdev, &platform_bus.device_list, next, tmp) {
- platform_bus_unplug(&pdev->device);
TAILQ_REMOVE(&platform_bus.device_list, pdev, next);
+ platform_bus_unplug(&pdev->device);
}
return 0;
--
2.34.1
next reply other threads:[~2023-08-24 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 10:52 Tomasz Duszynski [this message]
2023-10-02 8:34 ` David Marchand
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=20230824105225.822297-1-tduszynski@marvell.com \
--to=tduszynski@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=thomas@monjalon.net \
/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).