From: Adrian Bunk <bunk@kernel.org>
To: Anton Vorontsov <avorontsov@ru.mvista.com>,
Vitaly Bordug <vitb@kernel.crashing.org>,
Jeff Garzik <jeff@garzik.org>
Cc: netdev@vger.kernel.org
Subject: [2.6 patch] net/phy/fixed.c: fix a use-after-free
Date: Sat, 2 Feb 2008 23:15:02 +0200 [thread overview]
Message-ID: <20080202211502.GC9375@cs181133002.pp.htv.fi> (raw)
This patch fixes a use-after-free introduced by
commit a79d8e93d300adb84cccc38ac396cfb118c238ad and spotted by the
Coverity checker.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
20c51455b2faed63c3026fd4d7139e5a6a917d31
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 73b6d39..ca9b040 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -236,12 +236,12 @@ module_init(fixed_mdio_bus_init);
static void __exit fixed_mdio_bus_exit(void)
{
struct fixed_mdio_bus *fmb = &platform_fmb;
- struct fixed_phy *fp;
+ struct fixed_phy *fp, *tmp;
mdiobus_unregister(&fmb->mii_bus);
platform_device_unregister(pdev);
- list_for_each_entry(fp, &fmb->phys, node) {
+ list_for_each_entry_safe(fp, tmp, &fmb->phys, node) {
list_del(&fp->node);
kfree(fp);
}
next reply other threads:[~2008-02-02 21:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 21:15 Adrian Bunk [this message]
2008-02-03 14:21 ` [2.6 patch] net/phy/fixed.c: fix a use-after-free Anton Vorontsov
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=20080202211502.GC9375@cs181133002.pp.htv.fi \
--to=bunk@kernel.org \
--cc=avorontsov@ru.mvista.com \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
--cc=vitb@kernel.crashing.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