Skip to content
Commit c938ab4d authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

net: phy: Manual remove LEDs to ensure correct ordering



If the core is left to remove the LEDs via devm_, it is performed too
late, after the PHY driver is removed from the PHY. This results in
dereferencing a NULL pointer when the LED core tries to turn the LED
off before destroying the LED.

Manually unregister the LEDs at a safe point in phy_remove.

Cc: stable@vger.kernel.org
Reported-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Suggested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Fixes: 01e5b728

 ("net: phy: Add a binding for PHY LEDs")
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb09fc2d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment