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: b1c17215d7
("stmmac: add ipq806x glue layer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3f2a1b5433
commit
cc3db046c0
1 changed files with 1 additions and 1 deletions
|
@ -203,7 +203,7 @@ static void *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 ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue