Skip to content

Commit 3c42b33

Browse files
Jork Loeserliuw
authored andcommitted
Drivers: hv: vmbus: fix hyperv_cpuhp_online variable shadowing
vmbus_alloc_synic_and_connect() declares a local 'int hyperv_cpuhp_online' that shadows the file-scope global of the same name. The cpuhp state returned by cpuhp_setup_state() is stored in the local, leaving the global at 0 (CPUHP_OFFLINE). When hv_kexec_handler() or hv_machine_shutdown() later call cpuhp_remove_state(hyperv_cpuhp_online) they pass 0, which hits the BUG_ON in __cpuhp_remove_state_cpuslocked(). Remove the local declaration so the cpuhp state is stored in the file-scope global where hv_kexec_handler() and hv_machine_shutdown() expect it. Fixes: 2647c96 ("Drivers: hv: Support establishing the confidential VMBus connection") Signed-off-by: Jork Loeser <jloeser@linux.microsoft.com> Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
1 parent cfc4268 commit 3c42b33

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

drivers/hv/vmbus_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,6 @@ static int vmbus_alloc_synic_and_connect(void)
14231423
{
14241424
int ret, cpu;
14251425
struct work_struct __percpu *works;
1426-
int hyperv_cpuhp_online;
14271426

14281427
ret = hv_synic_alloc();
14291428
if (ret < 0)

0 commit comments

Comments
 (0)