On Tue, Dec 16, 2025 at 02:20:30PM +0000, Anirudh Rayabharam wrote:
> From: Anirudh Rayabharam (Microsoft) <[email protected]>
> 
> 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.
> 

Please, add the corresponding "Fixes" tag.

Acked-by: Stanislav Kinsburskii <[email protected]>

> Signed-off-by: Anirudh Rayabharam (Microsoft) <[email protected]>
> ---
>  drivers/hv/mshv_regions.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hv/mshv_regions.c b/drivers/hv/mshv_regions.c
> index 8abf80129f9b..30bacba6aec3 100644
> --- a/drivers/hv/mshv_regions.c
> +++ b/drivers/hv/mshv_regions.c
> @@ -511,7 +511,7 @@ static bool mshv_region_interval_invalidate(struct 
> mmu_interval_notifier *mni,
>       ret = mshv_region_remap_pages(region, HV_MAP_GPA_NO_ACCESS,
>                                     page_offset, page_count);
>       if (ret)
> -             goto out_fail;
> +             goto out_unlock;
>  
>       mshv_region_invalidate_pages(region, page_offset, page_count);
>  
> @@ -519,6 +519,8 @@ static bool mshv_region_interval_invalidate(struct 
> mmu_interval_notifier *mni,
>  
>       return true;
>  
> +out_unlock:
> +     mutex_unlock(&region->mutex);
>  out_fail:
>       WARN_ONCE(ret,
>                 "Failed to invalidate region %#llx-%#llx (range %#lx-%#lx, 
> event: %u, pages %#llx-%#llx, mm: %#llx): %d\n",
> -- 
> 2.34.1
> 

Reply via email to