]> git.baikalelectronics.ru Git - kernel.git/commit
smp: Fix error case handling in smp_call_function_*()
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 19 Apr 2015 08:56:03 +0000 (04:56 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 19 Apr 2015 20:19:23 +0000 (13:19 -0700)
commitd05e15e299754a16b923a4b3e0116377ea962aa5
treebee9cc7cfcb2c338d06bb933c1e76c2d3cf68a46
parent7482ff81dfaff8b5e2a6f661ba38ea35ffa40479
smp: Fix error case handling in smp_call_function_*()

Commit 309bb9cfd21a ("smp: Fix smp_call_function_single_async()
locking") fixed the locking for the asynchronous smp-call case, but in
the process of moving the lock handling around, one of the error cases
ended up not unlocking the call data at all.

This went unnoticed on x86, because this is a "caller is buggy" case,
where the caller is trying to call a non-existent CPU.  But apparently
ARM does that (at least under qemu-arm).  Bindly doing cross-cpu calls
to random CPU's that aren't even online seems a bit fishy, but the error
handling was clearly not correct.

Simply add the missing "csd_unlock()" to the error path.

Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Analyzed-by: Rabin Vincent <rabin@rab.in>
Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/smp.c