summaryrefslogtreecommitdiff
path: root/drivers/hv
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2016-12-07 12:16:26 +0300
committerBen Hutchings <ben@decadent.org.uk>2017-06-05 23:16:49 +0300
commit5aa052b223ec1c6a9669f542bfcad6f07c377210 (patch)
tree5d169685229fc469759a17467275b6adb6426e7c /drivers/hv
parentc5398ac16c168d9a6495cf492be8bcd1a48a8da2 (diff)
downloadlinux-5aa052b223ec1c6a9669f542bfcad6f07c377210.tar.xz
hv: init percpu_list in hv_synic_alloc()
commit 3c7630d35009e6635e5b58d62de554fd5b6db5df upstream. Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a crash in percpu_channel_enq() when not all CPUs were online during initialization and it naturally belongs there. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 1010eae3a7c8..b83afe484415 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -295,6 +295,8 @@ int hv_synic_alloc(void)
pr_err("Unable to allocate post msg page\n");
goto err;
}
+
+ INIT_LIST_HEAD(&hv_context.percpu_list[cpu]);
}
return 0;
@@ -386,8 +388,6 @@ void hv_synic_init(void *arg)
*/
rdmsrl(HV_X64_MSR_VP_INDEX, vp_index);
hv_context.vp_index[cpu] = (u32)vp_index;
-
- INIT_LIST_HEAD(&hv_context.percpu_list[cpu]);
return;
}