[PATCH] staging: dgnc: Remove useless and deadly judgment

Navy Cheng navych at 126.com
Mon Feb 29 01:41:34 EST 2016


pci_unregister_driver() should be used once dgnc module exit. It has
nothing to do with dgnc_NumBoards. Remove the judgment of dgnc_NumBoards to
avoid pci_unregister_driver() is not used when dgnc_NumBoards is 0.

Signed-off-by: Navy Cheng <navych at 126.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..20b0c3b 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -156,8 +156,7 @@ static void dgnc_cleanup_module(void)
 
 	dgnc_tty_post_uninit();
 
-	if (dgnc_NumBoards)
-		pci_unregister_driver(&dgnc_driver);
+	pci_unregister_driver(&dgnc_driver);
 }
 
 /*
-- 
2.1.4





More information about the Kernelnewbies mailing list