[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM6PR0402MB360703C2D2EAC8A58D7BEF2DFF890@AM6PR0402MB3607.eurprd04.prod.outlook.com>
Date: Thu, 4 Jun 2020 02:36:28 +0000
From: Andy Duan <fugang.duan@....com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>
CC: Alexandre Torgue <alexandre.torgue@...com>,
Jose Abreu <joabreu@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [EXT] [PATCH net-next] net: ethernet: dwmac: Fix an error code in
imx_dwmac_probe()
From: Dan Carpenter <dan.carpenter@...cle.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@...cle.com>
Thanks!
Acked-by: Fugang Duan <fugang.duan@....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
Powered by blists - more mailing lists