EDAC: Properly unwind on failure path in edac_init()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 6 Feb 2015 06:12:42 +0000 (22:12 -0800)
committerBorislav Petkov <bp@suse.de>
Mon, 23 Feb 2015 12:13:07 +0000 (13:13 +0100)
edac_init() does not deallocate already allocated resources on failure
path.

Found by Linux Driver Verification project (linuxtesting.org).

 [ Boris: The unwind path functions have __exit annotation but are being
   used in an __init function, leading to section mismatches. Drop the
   section annotation and make them normal functions. ]

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Link: http://lkml.kernel.org/r/1423203162-26368-1-git-send-email-khoroshilov@ispras.ru
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/edac_mc_sysfs.c
drivers/edac/edac_module.c

index 3a28381..112d63a 100644 (file)
@@ -914,7 +914,7 @@ int __init edac_debugfs_init(void)
        return 0;
 }
 
-void __exit edac_debugfs_exit(void)
+void edac_debugfs_exit(void)
 {
        debugfs_remove(edac_debugfs);
 }
@@ -1155,7 +1155,7 @@ int __init edac_mc_sysfs_init(void)
        return err;
 }
 
-void __exit edac_mc_sysfs_exit(void)
+void edac_mc_sysfs_exit(void)
 {
        device_unregister(mci_pdev);
        edac_put_sysfs_subsys();
Simple merge