diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-06-03 20:50:25 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-04 15:51:25 -0700 |
commit | f6c1fb0a76d97447ea7f928ee6a113ee15318df1 (patch) | |
tree | a9758ea2f61c561ec4dde2bc364703fc77cb9aa9 | |
parent | c7e261d81783387a0502878cd229327e7c54322e (diff) | |
download | linux-f6c1fb0a76d97447ea7f928ee6a113ee15318df1.tar.bz2 |
net: ethernet: dwmac: Fix an error code in imx_dwmac_probe()
The code is return PTR_ERR(NULL) which is zero or success. We should
return -ENOMEM instead.
Fixes: 94abdad6974a5 ("net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index 5010af7dab4a..3c5df5eeed6c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -225,7 +225,7 @@ static int imx_dwmac_probe(struct platform_device *pdev) dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); if (!dwmac) - return PTR_ERR(dwmac); + return -ENOMEM; plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac); if (IS_ERR(plat_dat)) |