net: stmmac: dwmac-meson8b: Fix signedness bug in probe
Subsystems (6)
PATCH 1/1 net: stmmac: dwmac-meson8b: Fix signedness bug in probe
The "dwmac->phy_mode" is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered.
Fixes 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +1 -1
@@ -339,7 +339,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev) dwmac->dev = &pdev->dev; dwmac->phy_mode =of_get_phy_mode (pdev->dev.of_node); -if (dwmac->phy_mode <0 ) { +if ((int )dwmac->phy_mode <0 ) {dev_err (&pdev->dev,"missing phy-mode property\n" ); ret = -EINVAL ; goto err_remove_config_dt;
Signature · 1 line
2.20.1
+Cc linux-amlogic mailing list
Quoted 6 lines · Dan Carpenter
The "
dwmac->phy_mode" is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered.Fixes 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Martin Blumenstingl <[email protected]>
thank you for catching and fixing this!
Martin
From: Dan Carpenter <[email protected]>
Date: Wed, 25 Sep 2019 13:58:22 +0300
Quoted 5 lines
The "
dwmac->phy_mode" is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered.Fixes 566e82516253 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")Signed-off-by Dan Carpenter <[email protected]>
Applied.