Skip to content

Commit

Permalink
net/phy/fixed.c: fix a use-after-free
Browse files Browse the repository at this point in the history
This patch fixes a use-after-free introduced by
commit a79d8e9 and spotted by the
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Adrian Bunk authored and Jeff Garzik committed Feb 11, 2008
1 parent d785ad7 commit 651be3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 651be3a

Please sign in to comment.