Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 651be3a2 authored by Adrian Bunk's avatar Adrian Bunk Committed by Jeff Garzik
Browse files

net/phy/fixed.c: fix a use-after-free



This patch fixes a use-after-free introduced by
commit a79d8e93 and spotted by the
Coverity checker.

Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent d785ad74
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
	}