netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: qlge: add unregister_netdev in qlge_probe
@ 2022-02-18  8:11 Hangyu Hua
  2022-02-18 12:03 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Hangyu Hua @ 2022-02-18  8:11 UTC (permalink / raw)
  To: manishc, GR-Linux-NIC-Dev, coiby.xu, gregkh
  Cc: netdev, linux-staging, linux-kernel, Hangyu Hua

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-21  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-18  8:11 [PATCH] staging: qlge: add unregister_netdev in qlge_probe Hangyu Hua
2022-02-18 12:03 ` Dan Carpenter
2022-02-21  1:47   ` Hangyu Hua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).