提交 dddacaf0 编写于 作者: D Dan Carpenter 提交者: Yang Yingliang

net: hisilicon: Fix signedness bug in hix5hd2_dev_probe()

[ Upstream commit 002dfe8085255b7bf1e0758c3d195c5412d35be9 ]

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b803351a
...@@ -1201,7 +1201,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev) ...@@ -1201,7 +1201,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册