Commit 4fcc0c27 authored by Hangyu Hua's avatar Hangyu Hua Committed by Greg Kroah-Hartman

staging: qlge: add unregister_netdev in qlge_probe

unregister_netdev need to be called when register_netdev succeeds
qlge_health_create_reporters fails.

Fixes: d8827ae8 ("staging: qlge: deal with the case that devlink_health_reporter_create fails")
Signed-off-by: default avatarHangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20220221085552.93561-1-hbh25y@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60f1d3c9
......@@ -4605,14 +4605,12 @@ static int qlge_probe(struct pci_dev *pdev,
err = register_netdev(ndev);
if (err) {
dev_err(&pdev->dev, "net device registration failed.\n");
qlge_release_all(pdev);
pci_disable_device(pdev);
goto netdev_free;
goto cleanup_pdev;
}
err = qlge_health_create_reporters(qdev);
if (err)
goto netdev_free;
goto unregister_netdev;
/* Start up the timer to trigger EEH if
* the bus goes dead
......@@ -4626,6 +4624,11 @@ static int qlge_probe(struct pci_dev *pdev,
devlink_register(devlink);
return 0;
unregister_netdev:
unregister_netdev(ndev);
cleanup_pdev:
qlge_release_all(pdev);
pci_disable_device(pdev);
netdev_free:
free_netdev(ndev);
devlink_free:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment