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: 99100d0d99 ("net: enetc: add preliminary support for i.MX95 ENETC PF")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/93888efa-c838-4682-a7e5-e6bf318e844e@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Dan Carpenter 2024-11-13 10:31:25 +03:00 committed by Jakub Kicinski
parent 575092a7f0
commit f66af96161

View File

@ -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);