mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
pasemi_mac: ethtool get settings fix
Not all pasemi mac interfaces can have a phy attached. For example, XAUI has no phy and phydev is NULL for it. In this case ethtool get settings causes kernel crash. Fix it by returning -EOPNOTSUPP if there's no PHY attached. Signed-off-by: Valentine Barshak <[email protected]> Acked-by: Olof Johansson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6e43650cee
commit
49682864b0
1 changed files with 3 additions and 0 deletions
|
|
@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct net_device *netdev,
|
|||
struct pasemi_mac *mac = netdev_priv(netdev);
|
||||
struct phy_device *phydev = mac->phydev;
|
||||
|
||||
if (!phydev)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return phy_ethtool_gset(phydev, cmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue