提交 49682864 编写于 作者: V Valentine Barshak 提交者: David S. Miller

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: NValentine Barshak <vbarshak@ru.mvista.com>
Acked-by: NOlof Johansson <olof@lixom.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6e43650c
...@@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct net_device *netdev, ...@@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct net_device *netdev,
struct pasemi_mac *mac = netdev_priv(netdev); struct pasemi_mac *mac = netdev_priv(netdev);
struct phy_device *phydev = mac->phydev; struct phy_device *phydev = mac->phydev;
if (!phydev)
return -EOPNOTSUPP;
return phy_ethtool_gset(phydev, cmd); return phy_ethtool_gset(phydev, cmd);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册