summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/mdio-mux.c
diff options
context:
space:
mode:
authorColin Ian King2017-06-05 20:08:04 +0200
committerDavid S. Miller2017-06-05 23:45:51 +0200
commit9d15e5cc8cb68326f7f89b76e04c834fe8e1a2db (patch)
treefb6dfea8aeb0823f2d3b498eb1e6aadfaa835d6b /drivers/net/phy/mdio-mux.c
parentnet-next: stmmac: dwmac-sun8i: ensure the EPHY is properly reseted (diff)
downloadkernel-qcow2-linux-9d15e5cc8cb68326f7f89b76e04c834fe8e1a2db.tar.gz
kernel-qcow2-linux-9d15e5cc8cb68326f7f89b76e04c834fe8e1a2db.tar.xz
kernel-qcow2-linux-9d15e5cc8cb68326f7f89b76e04c834fe8e1a2db.zip
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>
Diffstat (limited to 'drivers/net/phy/mdio-mux.c')
-rw-r--r--drivers/net/phy/mdio-mux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
index 47ded3904050..00755b6a42cf 100644
--- a/drivers/net/phy/mdio-mux.c
+++ b/drivers/net/phy/mdio-mux.c
@@ -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) {