mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
Drivers: hv: Check message and event pages for non-NULL before iounmap()
It might happen that some hyp SynIC pages aren't allocated. Check for that and only then call iounmap(). Signed-off-by: Roman Kisel <romank@linux.microsoft.com> Reviewed-by: Tianyu Lan <tiala@microsoft.com> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
This commit is contained in:
parent
1bb15327d5
commit
09406f2f84
|
|
@ -371,8 +371,10 @@ void hv_synic_disable_regs(unsigned int cpu)
|
|||
*/
|
||||
simp.simp_enabled = 0;
|
||||
if (ms_hyperv.paravisor_present || hv_root_partition()) {
|
||||
iounmap(hv_cpu->hyp_synic_message_page);
|
||||
hv_cpu->hyp_synic_message_page = NULL;
|
||||
if (hv_cpu->hyp_synic_message_page) {
|
||||
iounmap(hv_cpu->hyp_synic_message_page);
|
||||
hv_cpu->hyp_synic_message_page = NULL;
|
||||
}
|
||||
} else {
|
||||
simp.base_simp_gpa = 0;
|
||||
}
|
||||
|
|
@ -383,8 +385,10 @@ void hv_synic_disable_regs(unsigned int cpu)
|
|||
siefp.siefp_enabled = 0;
|
||||
|
||||
if (ms_hyperv.paravisor_present || hv_root_partition()) {
|
||||
iounmap(hv_cpu->hyp_synic_event_page);
|
||||
hv_cpu->hyp_synic_event_page = NULL;
|
||||
if (hv_cpu->hyp_synic_event_page) {
|
||||
iounmap(hv_cpu->hyp_synic_event_page);
|
||||
hv_cpu->hyp_synic_event_page = NULL;
|
||||
}
|
||||
} else {
|
||||
siefp.base_siefp_gpa = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user