Skip to content

Commit

Permalink
mdio: mux: fix an incorrect less than zero error check using a u32
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and David S. Miller committed Jun 5, 2017
1 parent 2f87849 commit 9d15e5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/mdio-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int mdio_mux_init(struct device *dev,

ret_val = -ENODEV;
for_each_available_child_of_node(dev->of_node, child_bus_node) {
u32 v;
int v;

v = of_mdio_parse_addr(dev, child_bus_node);
if (v < 0) {
Expand Down

0 comments on commit 9d15e5c

Please sign in to comment.