* [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe()
@ 2020-06-03 17:50 Dan Carpenter
2020-06-04 2:36 ` [EXT] " Andy Duan
2020-06-04 22:52 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-06-03 17:50 UTC (permalink / raw)
To: Giuseppe Cavallaro, Fugang Duan
Cc: Alexandre Torgue, Jose Abreu, David S. Miller, Jakub Kicinski,
Maxime Coquelin, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team, netdev, linux-stm32,
kernel-janitors
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>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index 5010af7dab4af..3c5df5eeed6c8 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))
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [EXT] [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe()
2020-06-03 17:50 [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe() Dan Carpenter
@ 2020-06-04 2:36 ` Andy Duan
2020-06-04 22:52 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Andy Duan @ 2020-06-04 2:36 UTC (permalink / raw)
To: Dan Carpenter, Giuseppe Cavallaro
Cc: Alexandre Torgue, Jose Abreu, David S. Miller, Jakub Kicinski,
Maxime Coquelin, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, dl-linux-imx, netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
kernel-janitors@vger.kernel.org
From: Dan Carpenter <dan.carpenter@oracle.com> Sent: Thursday, June 4, 2020 1:50 AM
> 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>
Thanks!
Acked-by: Fugang Duan <fugang.duan@nxp.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> index 5010af7dab4af..3c5df5eeed6c8 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))
> --
> 2.26.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe()
2020-06-03 17:50 [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe() Dan Carpenter
2020-06-04 2:36 ` [EXT] " Andy Duan
@ 2020-06-04 22:52 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-06-04 22:52 UTC (permalink / raw)
To: dan.carpenter
Cc: peppe.cavallaro, fugang.duan, alexandre.torgue, joabreu, kuba,
mcoquelin.stm32, shawnguo, s.hauer, kernel, festevam, linux-imx,
netdev, linux-stm32, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 3 Jun 2020 20:50:25 +0300
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-04 22:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-03 17:50 [PATCH net-next] net: ethernet: dwmac: Fix an error code in imx_dwmac_probe() Dan Carpenter
2020-06-04 2:36 ` [EXT] " Andy Duan
2020-06-04 22:52 ` 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).