[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB851005FFBC916885F13F1A89885A2@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Wed, 13 Nov 2024 07:42:06 +0000
From: Wei Fang <wei.fang@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: Claudiu Manoil <claudiu.manoil@....com>, Vladimir Oltean
<vladimir.oltean@....com>, Clark Wang <xiaoning.wang@....com>, Andrew Lunn
<andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Frank Li <frank.li@....com>, "imx@...ts.linux.dev"
<imx@...ts.linux.dev>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH net-next] net: enetc: clean up before returning in probe()
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@...aro.org>
> Sent: 2024年11月13日 15:31
> To: Wei Fang <wei.fang@....com>
> Cc: Claudiu Manoil <claudiu.manoil@....com>; Vladimir Oltean
> <vladimir.oltean@....com>; Clark Wang <xiaoning.wang@....com>; Andrew
> Lunn <andrew+netdev@...n.ch>; David S. Miller <davem@...emloft.net>; Eric
> Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo
> Abeni <pabeni@...hat.com>; Frank Li <frank.li@....com>; imx@...ts.linux.dev;
> netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> kernel-janitors@...r.kernel.org
> Subject: [PATCH net-next] net: enetc: clean up before returning in probe()
>
> We recently added this error path. We need to call enetc_pci_remove()
> before returning. It cleans up the resources from enetc_pci_probe().
>
> Fixes: 99100d0d9922 ("net: enetc: add preliminary support for i.MX95 ENETC
> PF")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> drivers/net/ethernet/freescale/enetc/enetc_vf.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
> b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
> index d18c11e406fc..a5f8ce576b6e 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
> @@ -174,9 +174,11 @@ static int enetc_vf_probe(struct pci_dev *pdev,
> si = pci_get_drvdata(pdev);
> si->revision = ENETC_REV_1_0;
> err = enetc_get_driver_data(si);
> - if (err)
> - return dev_err_probe(&pdev->dev, err,
> - "Could not get VF driver data\n");
> + if (err) {
> + dev_err_probe(&pdev->dev, err,
> + "Could not get VF driver data\n");
> + goto err_alloc_netdev;
> + }
>
> enetc_get_si_caps(si);
>
> --
> 2.45.2
Thanks for fixing this error path.
Reviewed-by: Wei Fang <wei.fang@....com>
Powered by blists - more mailing lists