page_track_handler take lock at the beginning, the lock should be released
at the failure of finding page track. Otherwise deadlock will happen.
Fixes: e502a2af4c35 ("drm/i915/gvt: Provide generic page_track infrastructure for write-protected page")
Signed-off-by: Xiong Zhang <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
page_track = intel_vgpu_find_page_track(vgpu, gpa >> PAGE_SHIFT);
if (!page_track)
- return 0;
+ goto out;
if (unlikely(vgpu->failsafe)) {
/* Remove write protection to prevent furture traps. */
gvt_err("guest page write error, gpa %llx\n", gpa);
}
+out:
mutex_unlock(&gvt->lock);
return ret;
}