From: Dan Carpenter Date: Wed, 25 Sep 2019 11:05:24 +0000 (+0300) Subject: net: nixge: Fix a signedness bug in nixge_probe() X-Git-Tag: v4.19.99~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42a9b766ab1ff36d0e168a5b9e29783394596948;p=platform%2Fkernel%2Flinux-rpi.git net: nixge: Fix a signedness bug in nixge_probe() [ Upstream commit 1a4b62a0b8a3b81eca24366f63e214a7144b9f02 ] The "priv->phy_mode" is an enum and in this context GCC will treat it as an unsigned int so it can never be less than zero. Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 76efed0..a791d79 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c @@ -1233,7 +1233,7 @@ static int nixge_probe(struct platform_device *pdev) } priv->phy_mode = of_get_phy_mode(pdev->dev.of_node); - if (priv->phy_mode < 0) { + if ((int)priv->phy_mode < 0) { netdev_err(ndev, "not find \"phy-mode\" property\n"); err = -EINVAL; goto unregister_mdio;