Skip to content

Commit

Permalink
net: socionext: Fix a signedness bug in ave_probe()
Browse files Browse the repository at this point in the history
The "phy_mode" variable is an enum and in this context GCC treats it as
an unsigned int so the error handling is never triggered.

Fixes: 4c270b5 ("net: ethernet: socionext: add AVE ethernet driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Sep 27, 2019
1 parent ced81eb commit 7f9e88e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/socionext/sni_ave.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ static int ave_probe(struct platform_device *pdev)

np = dev->of_node;
phy_mode = of_get_phy_mode(np);
if (phy_mode < 0) {
if ((int)phy_mode < 0) {
dev_err(dev, "phy-mode not found\n");
return -EINVAL;
}
Expand Down

0 comments on commit 7f9e88e

Please sign in to comment.