projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drivers: hv: make VMBus bus ids persistent
[cascardo/linux.git]
/
drivers
/
hv
/
hv.c
diff --git
a/drivers/hv/hv.c
b/drivers/hv/hv.c
index
a1c086b
..
60dbd6c
100644
(file)
--- a/
drivers/hv/hv.c
+++ b/
drivers/hv/hv.c
@@
-278,7
+278,7
@@
cleanup:
*
* This routine is called normally during driver unloading or exiting.
*/
*
* 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;
{
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);
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;
}
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);
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
hv_context.tsc_page = NULL;
}
#endif