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

net: ethernet: stmmac: Fix signedness bug in ipq806x_gmac_of_parse()

[ Upstream commit 231042181dc9d6122c6faba64e99ccb25f13cc6c ]

The "gmac->phy_mode" variable is an enum and in this context GCC will
treat it as an unsigned int so the error handling will never be
triggered.

Fixes: b1c17215 ("stmmac: add ipq806x glue layer")
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>
上级 d2f10c8d
...@@ -191,7 +191,7 @@ static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac) ...@@ -191,7 +191,7 @@ static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
struct device *dev = &gmac->pdev->dev; struct device *dev = &gmac->pdev->dev;
gmac->phy_mode = of_get_phy_mode(dev->of_node); gmac->phy_mode = of_get_phy_mode(dev->of_node);
if (gmac->phy_mode < 0) { if ((int)gmac->phy_mode < 0) {
dev_err(dev, "missing phy mode property\n"); dev_err(dev, "missing phy mode property\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册