Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73e211e1 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

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: ee06b172 ("net: axienet: add support for standard phy-mode binding")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f1021051
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1762,7 +1762,7 @@ static int axienet_probe(struct platform_device *pdev)
		}
	} else {
		lp->phy_mode = of_get_phy_mode(pdev->dev.of_node);
		if (lp->phy_mode < 0) {
		if ((int)lp->phy_mode < 0) {
			ret = -EINVAL;
			goto free_netdev;
		}