]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: bcm54140: fix less than zero comparison on an unsigned
authorColin Ian King <colin.king@canonical.com>
Thu, 23 Apr 2020 14:10:16 +0000 (15:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Apr 2020 22:56:47 +0000 (15:56 -0700)
commit47188428e05a2a51cc829d75df0819d8ec85defc
tree1b3f110abe02e227842b7b2c1d2e486bb344e84e
parent19a294aff01da3f77bfff531da5bdb9e296d7c77
net: phy: bcm54140: fix less than zero comparison on an unsigned

Currently the unsigned variable tmp is being checked for an negative
error return from the call to bcm_phy_read_rdb and this can never
be true since tmp is unsigned.  Fix this by making tmp a plain int.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 8aea8672e390 ("net: phy: bcm54140: add hwmon support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Michael Walle <michael@walle.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/bcm54140.c