Commit 0dfdbc74 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-phy-Unbind-fixes'

Florian Fainelli says:

====================
net: phy: Unbind fixes

This patch series fixes a couple of issues with the unbinding of the PHY
drivers and then bringing down a network interface. The first is a NULL
pointer de-reference and the second was an incorrect warning being
triggered.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 19a83d36 5116a8ad
...@@ -996,7 +996,7 @@ void phy_stop(struct phy_device *phydev) ...@@ -996,7 +996,7 @@ void phy_stop(struct phy_device *phydev)
{ {
struct net_device *dev = phydev->attached_dev; struct net_device *dev = phydev->attached_dev;
if (!phy_is_started(phydev)) { if (!phy_is_started(phydev) && phydev->state != PHY_DOWN) {
WARN(1, "called from state %s\n", WARN(1, "called from state %s\n",
phy_state_to_str(phydev->state)); phy_state_to_str(phydev->state));
return; return;
......
...@@ -1682,7 +1682,8 @@ void phy_detach(struct phy_device *phydev) ...@@ -1682,7 +1682,8 @@ void phy_detach(struct phy_device *phydev)
phy_led_triggers_unregister(phydev); phy_led_triggers_unregister(phydev);
module_put(phydev->mdio.dev.driver->owner); if (phydev->mdio.dev.driver)
module_put(phydev->mdio.dev.driver->owner);
/* If the device had no specific driver before (i.e. - it /* If the device had no specific driver before (i.e. - it
* was using the generic driver), we unbind the device * was using the generic driver), we unbind the device
......
Markdown is supported
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