lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437051500-20419-1-git-send-email-sudipm.mukherjee@gmail.com>
Date:	Thu, 16 Jul 2015 18:28:17 +0530
From:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
To:	Lidza Louina <lidza.louina@...il.com>,
	Mark Hounschell <markh@...pro.net>,
	Daeseok Youn <daeseok.youn@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-kernel@...r.kernel.org,
	driverdev-devel@...uxdriverproject.org, devel@...verdev.osuosl.org,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH 1/4] 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@...torindia.org>
---

we had a discussion about the init and error path few months back when
another patch was sent. I am not able to find that discussion in
lkml.org

 drivers/staging/dgap/dgap.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 26b0446..3a783bf 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;
 }
 
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ