Skip to content

Commit

Permalink
net: nixge: Fix a signedness bug in nixge_probe()
Browse files Browse the repository at this point in the history
The "priv->phy_mode" is an enum and in this context GCC will treat it
as an unsigned int so it can never be less than zero.

Fixes: 492caff ("net: ethernet: nixge: Add support for National Instruments XGE netdev")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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 d7eb651 commit 1a4b62a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/ni/nixge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ static int nixge_probe(struct platform_device *pdev)
}

priv->phy_mode = of_get_phy_mode(pdev->dev.of_node);
if (priv->phy_mode < 0) {
if ((int)priv->phy_mode < 0) {
netdev_err(ndev, "not find \"phy-mode\" property\n");
err = -EINVAL;
goto unregister_mdio;
Expand Down

0 comments on commit 1a4b62a

Please sign in to comment.