net: nixge: Fix a signedness bug in nixge_probe()
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: 492caffa8a
("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>
This commit is contained in:
committed by
David S. Miller
parent
d7eb651212
commit
1a4b62a0b8
@@ -1347,7 +1347,7 @@ static int nixge_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
priv->phy_mode = of_get_phy_mode(pdev->dev.of_node);
|
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");
|
netdev_err(ndev, "not find \"phy-mode\" property\n");
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto unregister_mdio;
|
goto unregister_mdio;
|
||||||
|
Reference in New Issue
Block a user