Skip to content

Commit

Permalink
drm/i915/gvt: Release gvt->lock at the failure of finding page track
Browse files Browse the repository at this point in the history
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: e502a2a ("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]>
  • Loading branch information
xiongzha authored and zhenyw committed Mar 6, 2018
1 parent 6846dfe commit 7e60946
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/gvt/page_track.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa,

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. */
Expand All @@ -176,6 +176,7 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa,
gvt_err("guest page write error, gpa %llx\n", gpa);
}

out:
mutex_unlock(&gvt->lock);
return ret;
}

0 comments on commit 7e60946

Please sign in to comment.