Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 979048e1 authored by Will Deacon's avatar Will Deacon Committed by Robert Richter
Browse files

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: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent 2bfc96a1
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -257,17 +257,10 @@ static int __init oprofile_init(void)
		printk(KERN_INFO "oprofile: using timer interrupt.\n");
		err = oprofile_timer_init(&oprofile_ops);
		if (err)
			goto out_arch;
	}
	err = oprofilefs_register();
	if (err)
		goto out_arch;
	return 0;

out_arch:
	oprofile_arch_exit();
			return err;
	}
	return oprofilefs_register();
}


static void __exit oprofile_exit(void)