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

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

net: socionext: Fix a signedness bug in ave_probe()



[ Upstream commit 7f9e88e6ef8c971f2c638b5ff7044c59b5d0f58d ]

The "phy_mode" variable is an enum and in this context GCC treats it as
an unsigned int so the error handling is never triggered.

Fixes: 4c270b55 ("net: ethernet: socionext: add AVE ethernet driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fb3809dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1575,7 +1575,7 @@ static int ave_probe(struct platform_device *pdev)

	np = dev->of_node;
	phy_mode = of_get_phy_mode(np);
	if (phy_mode < 0) {
	if ((int)phy_mode < 0) {
		dev_err(dev, "phy-mode not found\n");
		return -EINVAL;
	}