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

Commit bb8179ad authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

net: axienet: fix a signedness bug in probe



[ Upstream commit 73e211e11be86715d66bd3c9d38b3c34b05fca9a ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 39c421cb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1573,7 +1573,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;
		}