]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: stmmac: dwmac-meson8b: Fix signedness bug in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 25 Sep 2019 10:58:22 +0000 (13:58 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit f10210517a2f37feea2edf85eb34c98977265c16 ]

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 <dan.carpenter@oracle.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c

index 8be4b32544ef86cd85304f6903a285f2ff1efc0e..d71d3c1c85eed7cfdb2c4e79104f7ef305b99995 100644 (file)
@@ -285,7 +285,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
 
        dwmac->pdev = pdev;
        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;