Re: [PATCH v2] net: phy: Fix use after free in phy_detach()

2016-11-29 Thread David Miller
From: Geert Uytterhoeven Date: Mon, 28 Nov 2016 15:18:31 +0100 > If device_release_driver(&phydev->mdio.dev) is called, it releases all > resources belonging to the PHY device. Hence the subsequent call to > phy_led_triggers_unregister() will access already freed memory when > unregistering the L

Re: [PATCH v2] net: phy: Fix use after free in phy_detach()

2016-11-28 Thread Zach Brown
On Mon, Nov 28, 2016 at 03:18:31PM +0100, Geert Uytterhoeven wrote: > If device_release_driver(&phydev->mdio.dev) is called, it releases all > resources belonging to the PHY device. Hence the subsequent call to > phy_led_triggers_unregister() will access already freed memory when > unregistering th

[PATCH v2] net: phy: Fix use after free in phy_detach()

2016-11-28 Thread Geert Uytterhoeven
If device_release_driver(&phydev->mdio.dev) is called, it releases all resources belonging to the PHY device. Hence the subsequent call to phy_led_triggers_unregister() will access already freed memory when unregistering the LEDs. Move the call to phy_led_triggers_unregister() before the possible