]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: realtek: net: Fix less than zero comparison of a u16
authorColin Ian King <colin.king@canonical.com>
Wed, 9 Jun 2021 17:17:48 +0000 (18:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 22:32:08 +0000 (15:32 -0700)
commit1cef1f124a52720d25dce9e05bc4aef78cb8aa45
tree63b57b71ca26fa1421f103862b2aa91f159f2363
parent1d5df363db0ae3c23738f5e205769b5dd1cc9ba8
net: phy: realtek: net: Fix less than zero comparison of a u16

The comparisons of the u16 values priv->phycr1 and priv->phycr2 to less
than zero always false because they are unsigned. Fix this by using an
int for the assignment and less than zero check.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 2ea66ed9b71b ("net: phy: realtek: add dt property to disable CLKOUT clock")
Fixes: 26ac47a7fa30 ("net: phy: realtek: add dt property to enable ALDPS mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/realtek.c