From: Al Viro Date: Sat, 17 Mar 2012 05:50:32 +0000 (-0400) Subject: ibmasmfs: make register_filesystem the last failure exit X-Git-Tag: v3.4-rc1~163^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea23b453103e7495ef0a90c86b92f27e17092bfa;p=platform%2Fkernel%2Flinux-stable.git ibmasmfs: make register_filesystem the last failure exit Signed-off-by: Al Viro --- diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c index 1ccedb71..168d800 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;