]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: don't allow __set_phy_supported to add unsupported modes
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 3 Dec 2018 07:19:33 +0000 (08:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2018 08:38:31 +0000 (09:38 +0100)
commit4f384d9427385d42a97200fbb22998bfffb2ad10
tree9ac0c12e7e62c54630fb8b58612138e80ef36cbd
parent5765610c932df91cc3b93f8e069a02e946fa44bd
net: phy: don't allow __set_phy_supported to add unsupported modes

[ Upstream commit d2a36971ef595069b7a600d1144c2e0881a930a1 ]

Currently __set_phy_supported allows to add modes w/o checking whether
the PHY supports them. This is wrong, it should never add modes but
only remove modes we don't want to support.

The commit marked as fixed didn't do anything wrong, it just copied
existing functionality to the helper which is being fixed now.

Fixes: f3a6bd393c2c ("phylib: Add phy_set_max_speed helper")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phy_device.c