Skip to content

Commit

Permalink
Merge branch 'net-phy-Unbind-fixes'
Browse files Browse the repository at this point in the history
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: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Sep 17, 2020
2 parents 19a83d3 + 5116a8a commit 0dfdbc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ void phy_stop(struct phy_device *phydev)
{
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",
phy_state_to_str(phydev->state));
return;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,8 @@ void phy_detach(struct phy_device *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
* was using the generic driver), we unbind the device
Expand Down

0 comments on commit 0dfdbc7

Please sign in to comment.