diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-09-25 13:59:11 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-27 14:51:15 +0100 |
commit | bb8179ad7662fd44ddb9c721dbf3007aaa05f16f (patch) | |
tree | f04cf3dab450842d82bee2034e76b09a7d5e76d4 /drivers | |
parent | 39c421cb2721d7bb4af3291e4b209b11bd1db4d6 (diff) |
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: ee06b1728b95 ("net: axienet: add support for standard phy-mode binding")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 28764268a44f..b093f14eeec3 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -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; } |