mirror of https://gitee.com/openkylin/linux.git
net: axienet: fix a signedness bug in probe
The "lp->phy_mode" is an enum but in this context GCC treats it as an
unsigned int so the error handling is never triggered.
Fixes: ee06b1728b
("net: axienet: add support for standard phy-mode binding")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f10210517a
commit
73e211e11b
|
@ -1762,7 +1762,7 @@ static int axienet_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lp->phy_mode = of_get_phy_mode(pdev->dev.of_node);
|
lp->phy_mode = of_get_phy_mode(pdev->dev.of_node);
|
||||||
if (lp->phy_mode < 0) {
|
if ((int)lp->phy_mode < 0) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto free_netdev;
|
goto free_netdev;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue