summaryrefslogtreecommitdiff
path: root/drivers/hv
diff options
context:
space:
mode:
authorSunil Muthuswamy <sunilmut@microsoft.com>2018-07-28 21:58:46 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-29 08:09:56 +0200
commit8afc06dd75c06b9d6e70e4a72fdafbd4cab8d1df (patch)
treedef648d460bdd455fd7072527a715f7023c8cf61 /drivers/hv
parentddcaf3ca4c3c87b955ad6f57952250030be77791 (diff)
Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr
The check to free the Hyper-V control table header was reversed. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy <sunilmut@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/vmbus_drv.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index a7f33c1f42c5..5e946b1be54c 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1176,11 +1176,8 @@ err_alloc:
bus_unregister(&hv_bus);
free_page((unsigned long)hv_panic_page);
- if (!hv_ctl_table_hdr) {
- unregister_sysctl_table(hv_ctl_table_hdr);
- hv_ctl_table_hdr = NULL;
- }
-
+ unregister_sysctl_table(hv_ctl_table_hdr);
+ hv_ctl_table_hdr = NULL;
return ret;
}
@@ -1891,11 +1888,8 @@ static void __exit vmbus_exit(void)
}
free_page((unsigned long)hv_panic_page);
- if (!hv_ctl_table_hdr) {
- unregister_sysctl_table(hv_ctl_table_hdr);
- hv_ctl_table_hdr = NULL;
- }
-
+ unregister_sysctl_table(hv_ctl_table_hdr);
+ hv_ctl_table_hdr = NULL;
bus_unregister(&hv_bus);
cpuhp_remove_state(hyperv_cpuhp_online);