diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-09-25 14:05:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 16:51:15 +0300 |
commit | 42a9b766ab1ff36d0e168a5b9e29783394596948 (patch) | |
tree | 7a0ecbd4f65daf02ba78ecb03723c7a5977033d1 /drivers/net/ethernet | |
parent | aa08e30cb7c481ced2ae7ea04441358fa71cd807 (diff) | |
download | linux-42a9b766ab1ff36d0e168a5b9e29783394596948.tar.xz |
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 <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/ni/nixge.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 76efed058f33..a791d7932b0e 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; |