Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32fc3fd4 authored by Sebastian Hesselbarth's avatar Sebastian Hesselbarth Committed by David S. Miller
Browse files

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: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fcad3e6b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -683,10 +683,9 @@ EXPORT_SYMBOL(phy_detach);
int phy_suspend(struct phy_device *phydev)
{
	struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
	struct ethtool_wolinfo wol;
	struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };

	/* If the device has WOL enabled, we cannot suspend the PHY */
	wol.cmd = ETHTOOL_GWOL;
	phy_ethtool_get_wol(phydev, &wol);
	if (wol.wolopts)
		return -EBUSY;