diff options
author | Valentine Barshak <vbarshak@ru.mvista.com> | 2009-10-04 23:27:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-07 06:37:43 -0400 |
commit | 49682864b0270a0578b8321ed2686dc471ec37f1 (patch) | |
tree | 3e1ab028bf5954bb795395a993808809000ba45d /drivers/net/pasemi_mac_ethtool.c | |
parent | 6e43650cee644b5d7957ecd50f1e41ff71f87734 (diff) |
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 <vbarshak@ru.mvista.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pasemi_mac_ethtool.c')
-rw-r--r-- | drivers/net/pasemi_mac_ethtool.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/pasemi_mac_ethtool.c b/drivers/net/pasemi_mac_ethtool.c index 064a4fe1dd90..28a86224879d 100644 --- a/drivers/net/pasemi_mac_ethtool.c +++ b/drivers/net/pasemi_mac_ethtool.c | |||
@@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct net_device *netdev, | |||
71 | struct pasemi_mac *mac = netdev_priv(netdev); | 71 | struct pasemi_mac *mac = netdev_priv(netdev); |
72 | struct phy_device *phydev = mac->phydev; | 72 | struct phy_device *phydev = mac->phydev; |
73 | 73 | ||
74 | if (!phydev) | ||
75 | return -EOPNOTSUPP; | ||
76 | |||
74 | return phy_ethtool_gset(phydev, cmd); | 77 | return phy_ethtool_gset(phydev, cmd); |
75 | } | 78 | } |
76 | 79 | ||