summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-03-17 01:50:32 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:44 -0400
commitea23b453103e7495ef0a90c86b92f27e17092bfa (patch)
tree631e91631278050750e6a5cb245bb00b954158b5
parent640045a1cd21d002caafa9eb9ed66cc31b88076a (diff)
downloadblackbird-op-linux-ea23b453103e7495ef0a90c86b92f27e17092bfa.tar.gz
blackbird-op-linux-ea23b453103e7495ef0a90c86b92f27e17092bfa.zip
ibmasmfs: make register_filesystem the last failure exit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/misc/ibmasm/module.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index 1ccedb71e728..168d8008f460 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -211,18 +211,17 @@ static void __exit ibmasm_exit (void)
static int __init ibmasm_init(void)
{
- int result;
+ int result = pci_register_driver(&ibmasm_driver);
+ if (result)
+ return result;
result = ibmasmfs_register();
if (result) {
+ pci_unregister_driver(&ibmasm_driver);
err("Failed to register ibmasmfs file system");
return result;
}
- result = pci_register_driver(&ibmasm_driver);
- if (result) {
- ibmasmfs_unregister();
- return result;
- }
+
ibmasm_register_panic_notifier();
info(DRIVER_DESC " version " DRIVER_VERSION " loaded");
return 0;
OpenPOWER on IntegriCloud