]> git.baikalelectronics.ru Git - kernel.git/commit
mdio: mux: fix an incorrect less than zero error check using a u32
authorColin Ian King <colin.king@canonical.com>
Mon, 5 Jun 2017 18:08:04 +0000 (19:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 21:45:51 +0000 (17:45 -0400)
commitf8778c50c95b302a58b2784a0c34dc6534b555ad
treefb6dfea8aeb0823f2d3b498eb1e6aadfaa835d6b
parentc4a03c2fbb52e9b9a91796f12641ac95487b7b51
mdio: mux: fix an incorrect less than zero error check using a u32

The u32 variable v is being checked to see if an error return is
less than zero and this check has no effect because it is unsigned.
Fix this by making v and int (this also matches the type of
cb->bus_number which is assigned to the value in v).

Detected by CoverityScan, CID#1440454 ("Unsigned compared against zero")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-mux.c