[PATCH] staging: qlge: add unregister_netdev in qlge_probe

Hangyu Hua
2022-02-18T08:11:53Z

unregister_netdev need to be called when register_netdev succeeds
qlge_health_create_reporters fails.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
drivers/staging/qlge/qlge_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 9873bb2a9ee4..0a199c6d77a1 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -4611,8 +4611,10 @@ static int qlge_probe(struct pci_dev *pdev,
}

err = qlge_health_create_reporters(qdev);
- if (err)
+ if (err) {
+ unregister_netdev(ndev);
goto netdev_free;
+ }

/* Start up the timer to trigger EEH if
* the bus goes dead
--
2.25.1