diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2015-02-06 09:12:42 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-02-23 15:13:07 +0300 |
commit | c6b97bcf8e3ee6643a7f90a54d1ef3f9e12ec245 (patch) | |
tree | e95d43f3b02159c2f70e2fbbdd564415509173c9 /drivers/edac/edac_module.c | |
parent | fc7cc6b7820b54119821a3c6838ff583d796a2ab (diff) | |
download | linux-c6b97bcf8e3ee6643a7f90a54d1ef3f9e12ec245.tar.xz |
EDAC: Properly unwind on failure path in edac_init()
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>
Diffstat (limited to 'drivers/edac/edac_module.c')
-rw-r--r-- | drivers/edac/edac_module.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c index e6d1691dfa45..9cb082a19d8a 100644 --- a/drivers/edac/edac_module.c +++ b/drivers/edac/edac_module.c @@ -112,20 +112,23 @@ static int __init edac_init(void) err = edac_mc_sysfs_init(); if (err) - goto error; + goto err_sysfs; edac_debugfs_init(); - /* Setup/Initialize the workq for this core */ err = edac_workqueue_setup(); if (err) { - edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n"); - goto error; + edac_printk(KERN_ERR, EDAC_MC, "Failure initializing workqueue\n"); + goto err_wq; } return 0; -error: +err_wq: + edac_debugfs_exit(); + edac_mc_sysfs_exit(); + +err_sysfs: return err; } |