aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2010-08-29 14:51:59 -0400
committerRobert Richter <robert.richter@amd.com>2010-08-31 05:47:50 -0400
commit979048e1f26190d16b5aea87166177f37e614439 (patch)
tree28c6e5c6c11343f934249cfdf9cc806f8a587758 /drivers
parent2bfc96a127bc1cc94d26bfaa40159966064f9c8c (diff)
oprofile: don't call arch exit code from init code on failure
oprofile_init calls oprofile_arch_init to initialise the architecture-specific backend code. If this backend code returns failure, oprofile_arch_exit is called immediately, making it difficult to allocate and free resources correctly. This patch removes the oprofile_arch_exit call from oprofile_init, meaning that all architectures must ensure that oprofile_arch_init cleans up any mess it's made before returning an error. As far as I can tell, this only affects the code for ARM. Cc: Robert Richter <robert.richter@amd.com> Cc: Matt Fleming <matt@console-pimps.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/oprofile/oprof.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
index b336cd9ee7a1..b4a685719dba 100644
--- a/drivers/oprofile/oprof.c
+++ b/drivers/oprofile/oprof.c
@@ -257,16 +257,9 @@ static int __init oprofile_init(void)
257 printk(KERN_INFO "oprofile: using timer interrupt.\n"); 257 printk(KERN_INFO "oprofile: using timer interrupt.\n");
258 err = oprofile_timer_init(&oprofile_ops); 258 err = oprofile_timer_init(&oprofile_ops);
259 if (err) 259 if (err)
260 goto out_arch; 260 return err;
261 } 261 }
262 err = oprofilefs_register(); 262 return oprofilefs_register();
263 if (err)
264 goto out_arch;
265 return 0;
266
267out_arch:
268 oprofile_arch_exit();
269 return err;
270} 263}
271 264
272 265