Commit 81d29da2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

net: hisilicon: Fix signedness bug in hix5hd2_dev_probe()

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit 002dfe80 ]

The "priv->phy_mode" variable is an enum and in this context GCC will
treat it as unsigned to the error handling will never trigger.

Fixes: 57c5bc9a ("net: hisilicon: add hix5hd2 mac driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent a83f4522
...@@ -951,7 +951,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev) ...@@ -951,7 +951,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
goto err_free_mdio; goto err_free_mdio;
priv->phy_mode = of_get_phy_mode(node); priv->phy_mode = of_get_phy_mode(node);
if (priv->phy_mode < 0) { if ((int)priv->phy_mode < 0) {
netdev_err(ndev, "not find phy-mode\n"); netdev_err(ndev, "not find phy-mode\n");
ret = -EINVAL; ret = -EINVAL;
goto err_mdiobus; goto err_mdiobus;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment