Skip to content

Commit

Permalink
[ARM] Solve buggy smp_processor_id() usage
Browse files Browse the repository at this point in the history
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 <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jun 2, 2007
1 parent 29c349d commit f72267c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/oprofile/op_model_mpcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f72267c

Please sign in to comment.