summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-07-16 14:58:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-16 19:19:55 +0200
commitac4e504a597903f65e6b365eee3e2675a7d8fe4e (patch)
tree1d7f852ae7eba66dd875b0aa191f5582e3c601fa /drivers
parentstaging: rtl8188eu: remove unneeded ret (diff)
downloadlinux-ac4e504a597903f65e6b365eee3e2675a7d8fe4e.tar.xz
linux-ac4e504a597903f65e6b365eee3e2675a7d8fe4e.zip
staging: dgap: fix error path
The code in dgap_stop() is almost a duplicate of the code that will be executed on pci_unregister_driver(). So the error code was stopping and unregistering everything twice. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/dgap/dgap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 26b0446d943a..3a783bff112d 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7133,8 +7133,10 @@ static int dgap_init_module(void)
return rc;
rc = pci_register_driver(&dgap_driver);
- if (rc)
- goto err_stop;
+ if (rc) {
+ dgap_stop();
+ return rc;
+ }
rc = dgap_create_driver_sysfiles(&dgap_driver);
if (rc)
@@ -7146,9 +7148,6 @@ static int dgap_init_module(void)
err_unregister:
pci_unregister_driver(&dgap_driver);
-err_stop:
- dgap_stop();
-
return rc;
}