diff options
| author | David S. Miller <davem@davemloft.net> | 2017-02-20 18:15:12 +0300 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-02-20 18:15:12 +0300 |
| commit | 5ed3fea0d6ffcef494b111ade0910a4ff149c331 (patch) | |
| tree | acc10c699ffcb5ceed825af9f051971f94387b09 /include/linux | |
| parent | cd2b708750582e327789d8fb07c6eb5f79f7759f (diff) | |
| parent | 25149ef9d25cafc4f4fe9f4461f18f876f397417 (diff) | |
| download | linux-5ed3fea0d6ffcef494b111ade0910a4ff149c331.tar.xz | |
Merge branch 'phy-unbind-crash'
Florian Fainelli says:
====================
net: phy: Fix PHY unbind crash
This fixes crashes when the PHY driver is no longer bound to the device.
There is still a fair amount of work to be done to get the unbind -> bind
sequent to result in a functional state, but that will be net-next material.
These two problems existed for as long as PHYLIB as been around.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/phy.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index d9bdf53e0514..772476028a65 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -807,6 +807,9 @@ int phy_stop_interrupts(struct phy_device *phydev); static inline int phy_read_status(struct phy_device *phydev) { + if (!phydev->drv) + return -EIO; + return phydev->drv->read_status(phydev); } |
