Skip to content

Commit 3a13f98

Browse files
Colin Ian Kingdavem330
authored andcommitted
net: phy: fix less than zero comparison with unsigned variable val
The unsigned variable val is being checked for an error by checking if it is less than zero. This can never occur because val is unsigned. Fix this by making val a plain int. Addresses-Coverity: ("Unsigned compared against zero") Fixes: bdbdac7 ("ethtool: provide UAPI for PHY master/slave configuration.") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ca7e3ed commit 3a13f98

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/net/phy/phy_device.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,7 @@ static int genphy_setup_master_slave(struct phy_device *phydev)
19481948
static int genphy_read_master_slave(struct phy_device *phydev)
19491949
{
19501950
int cfg, state;
1951-
u16 val;
1951+
int val;
19521952

19531953
if (!phydev->is_gigabit_capable) {
19541954
phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED;

0 commit comments

Comments
 (0)