mirror of https://gitee.com/openkylin/linux.git
net: ethernet: stmmac: Fix signedness bug in ipq806x_gmac_of_parse()
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: b1c17215d7
("stmmac: add ipq806x glue layer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1a4b62a0b8
commit
231042181d
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue