diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2014-03-14 05:07:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-14 22:38:54 -0400 |
commit | 32fc3fd41ae44a41ffb8fd5ec4f4764822104655 (patch) | |
tree | 5ffde54cb5f9c23de3b81f8afd37aec09885c248 /drivers/net/phy | |
parent | fcad3e6b576e78fce9ffca124a15de86b64453a0 (diff) |
net: phy: fix uninitalized ethtool_wolinfo in phy_suspend
Callers of phy_ethtool_get_wol are supposed to provide a properly
cleared struct ethtool_wolinfo. Therefore, fix phy_suspend to clear
it before passing it to phy_ethtool_get_wol.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/phy_device.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 4b970f7624c0..2f6989b1e0dc 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -683,10 +683,9 @@ EXPORT_SYMBOL(phy_detach); | |||
683 | int phy_suspend(struct phy_device *phydev) | 683 | int phy_suspend(struct phy_device *phydev) |
684 | { | 684 | { |
685 | struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); | 685 | struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); |
686 | struct ethtool_wolinfo wol; | 686 | struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL }; |
687 | 687 | ||
688 | /* If the device has WOL enabled, we cannot suspend the PHY */ | 688 | /* If the device has WOL enabled, we cannot suspend the PHY */ |
689 | wol.cmd = ETHTOOL_GWOL; | ||
690 | phy_ethtool_get_wol(phydev, &wol); | 689 | phy_ethtool_get_wol(phydev, &wol); |
691 | if (wol.wolopts) | 690 | if (wol.wolopts) |
692 | return -EBUSY; | 691 | return -EBUSY; |