From: Russell King Date: Sat, 2 Jun 2007 14:36:37 +0000 (+0100) Subject: [ARM] Solve buggy smp_processor_id() usage X-Git-Tag: v2.6.22-rc5~97^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f72267c30f5a08f9a77c97417ec120e6943195f8;p=linux-2.6 [ARM] Solve buggy smp_processor_id() usage BUG: using smp_processor_id() in preemptible [00000001] code: opcontrol/427 Resolve this bug by ensuring that we're not using smp_processor_id() in a preemptable context (by disabling preemption.) Signed-off-by: Russell King --- diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c index 7791da791f..75bae06792 100644 --- a/arch/arm/oprofile/op_model_mpcore.c +++ b/arch/arm/oprofile/op_model_mpcore.c @@ -200,8 +200,10 @@ static int em_call_function(int (*fn)(void)) data.fn = fn; data.ret = 0; + preempt_disable(); smp_call_function(em_func, &data, 1, 1); em_func(&data); + preempt_enable(); return data.ret; }