Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Roman Kisel and committed by
Wei Liu
09406f2f 1bb15327

+8 -4
+8 -4
drivers/hv/hv.c
··· 371 371 */ 372 372 simp.simp_enabled = 0; 373 373 if (ms_hyperv.paravisor_present || hv_root_partition()) { 374 - iounmap(hv_cpu->hyp_synic_message_page); 375 - hv_cpu->hyp_synic_message_page = NULL; 374 + if (hv_cpu->hyp_synic_message_page) { 375 + iounmap(hv_cpu->hyp_synic_message_page); 376 + hv_cpu->hyp_synic_message_page = NULL; 377 + } 376 378 } else { 377 379 simp.base_simp_gpa = 0; 378 380 } ··· 385 383 siefp.siefp_enabled = 0; 386 384 387 385 if (ms_hyperv.paravisor_present || hv_root_partition()) { 388 - iounmap(hv_cpu->hyp_synic_event_page); 389 - hv_cpu->hyp_synic_event_page = NULL; 386 + if (hv_cpu->hyp_synic_event_page) { 387 + iounmap(hv_cpu->hyp_synic_event_page); 388 + hv_cpu->hyp_synic_event_page = NULL; 389 + } 390 390 } else { 391 391 siefp.base_siefp_gpa = 0; 392 392 }