summaryrefslogtreecommitdiffstats
path: root/drivers/hv/channel.c
diff options
context:
space:
mode:
authorK. Y. Srinivasan2014-08-29 03:29:53 +0200
committerGreg Kroah-Hartman2014-09-24 08:31:21 +0200
commit2115b5617adf2eecca49e78f3810f359ddc5c396 (patch)
tree78deae37a3debee67b4cd30b54d948ad3cc1c8ab /drivers/hv/channel.c
parentDrivers: hv: vmbus: Cleanup hv_post_message() (diff)
downloadkernel-qcow2-linux-2115b5617adf2eecca49e78f3810f359ddc5c396.tar.gz
kernel-qcow2-linux-2115b5617adf2eecca49e78f3810f359ddc5c396.tar.xz
kernel-qcow2-linux-2115b5617adf2eecca49e78f3810f359ddc5c396.zip
Drivers: hv: vmbus: Properly protect calls to smp_processor_id()
Disable preemption when sampling current processor ID when preemption is otherwise possible. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/channel.c')
-rw-r--r--drivers/hv/channel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 19bad59073e6..433f72a1c006 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -486,11 +486,14 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
channel->state = CHANNEL_OPEN_STATE;
channel->sc_creation_callback = NULL;
/* Stop callback and cancel the timer asap */
- if (channel->target_cpu != smp_processor_id())
+ if (channel->target_cpu != get_cpu()) {
+ put_cpu();
smp_call_function_single(channel->target_cpu, reset_channel_cb,
channel, true);
- else
+ } else {
reset_channel_cb(channel);
+ put_cpu();
+ }
/* Send a closing message */