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.

mshv: release mutex on region invalidation failure

In the region invalidation failure path in
mshv_region_interval_invalidate(), the region mutex is not released. Fix
it by releasing the mutex in the failure path.

Signed-off-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Fixes: b9a66cd5ccbb ("mshv: Add support for movable memory regions")
Acked-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Roman Kisel <vdso@mailbox.org>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Anirudh Rayabharam (Microsoft) and committed by
Wei Liu
173d6f64 52f758ed

+3 -1
+3 -1
drivers/hv/mshv_regions.c
··· 511 511 ret = mshv_region_remap_pages(region, HV_MAP_GPA_NO_ACCESS, 512 512 page_offset, page_count); 513 513 if (ret) 514 - goto out_fail; 514 + goto out_unlock; 515 515 516 516 mshv_region_invalidate_pages(region, page_offset, page_count); 517 517 ··· 519 519 520 520 return true; 521 521 522 + out_unlock: 523 + mutex_unlock(&region->mutex); 522 524 out_fail: 523 525 WARN_ONCE(ret, 524 526 "Failed to invalidate region %#llx-%#llx (range %#lx-%#lx, event: %u, pages %#llx-%#llx, mm: %#llx): %d\n",