Merge remote-tracking branch 'char-misc/char-misc-next'
[deliverable/linux.git] / drivers / hv / hv.c
index a1c086ba3b9a0736c522d648092d04d4ac92a3c7..60dbd6cb4640cd6caeb36a8c07585660d812f3b9 100644 (file)
@@ -278,7 +278,7 @@ cleanup:
  *
  * This routine is called normally during driver unloading or exiting.
  */
-void hv_cleanup(void)
+void hv_cleanup(bool crash)
 {
        union hv_x64_msr_hypercall_contents hypercall_msr;
 
@@ -288,7 +288,8 @@ void hv_cleanup(void)
        if (hv_context.hypercall_page) {
                hypercall_msr.as_uint64 = 0;
                wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
-               vfree(hv_context.hypercall_page);
+               if (!crash)
+                       vfree(hv_context.hypercall_page);
                hv_context.hypercall_page = NULL;
        }
 
@@ -308,7 +309,8 @@ void hv_cleanup(void)
 
                hypercall_msr.as_uint64 = 0;
                wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64);
-               vfree(hv_context.tsc_page);
+               if (!crash)
+                       vfree(hv_context.tsc_page);
                hv_context.tsc_page = NULL;
        }
 #endif
This page took 0.024987 seconds and 5 git commands to generate.