提交 7f9e88e6 编写于 作者: D Dan Carpenter 提交者: David S. Miller

net: socionext: Fix a signedness bug in ave_probe()

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: 4c270b55 ("net: ethernet: socionext: add AVE ethernet driver")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ced81eb8
...@@ -1566,7 +1566,7 @@ static int ave_probe(struct platform_device *pdev) ...@@ -1566,7 +1566,7 @@ static int ave_probe(struct platform_device *pdev)
np = dev->of_node; np = dev->of_node;
phy_mode = of_get_phy_mode(np); phy_mode = of_get_phy_mode(np);
if (phy_mode < 0) { if ((int)phy_mode < 0) {
dev_err(dev, "phy-mode not found\n"); dev_err(dev, "phy-mode not found\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册