netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: axienet: fix a signedness bug in probe
@ 2019-09-25 10:59 Dan Carpenter
  2019-09-25 11:05 ` Alvaro G. M
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-09-25 10:59 UTC (permalink / raw)
  To: Radhey Shyam Pandey, Alvaro G. M
  Cc: David S. Miller, Michal Simek, Russell King, netdev,
	kernel-janitors

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>
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 4fc627fb4d11..676006f32f91 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1762,7 +1762,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;
 		}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-27  8:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-25 10:59 [PATCH net] net: axienet: fix a signedness bug in probe Dan Carpenter
2019-09-25 11:05 ` Alvaro G. M
2019-09-25 11:35   ` David Miller
2019-09-25 12:14     ` Andrew Lunn
2019-09-26 13:18   ` Dan Carpenter
2019-09-26 13:24     ` Andrew Lunn
2019-09-25 12:01 ` Radhey Shyam Pandey
2019-09-27  8:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).