summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-08-07 08:46:02 +0200
committerZhenyu Wang <zhenyuw@linux.intel.com>2018-08-14 09:26:59 +0200
commit4b25e737cfc7f2ade956df3c747a7dd2ff1e2774 (patch)
tree4752eb98ea45e68a57cde8847d6cf38617525b78 /drivers/gpu
parentdrm/i915/kvmgt: Fix potential Spectre v1 (diff)
downloadlinux-4b25e737cfc7f2ade956df3c747a7dd2ff1e2774.tar.xz
linux-4b25e737cfc7f2ade956df3c747a7dd2ff1e2774.zip
drm/i915/gvt: Off by one in intel_vgpu_write_fence()
The > should be >= here so that we don't read one element beyond the end of the array. Fixes: 28a60dee2ce6 ("drm/i915/gvt: vGPU HW resource management") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/gvt/aperture_gm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/aperture_gm.c b/drivers/gpu/drm/i915/gvt/aperture_gm.c
index 380eeb2a0e83..fe754022e356 100644
--- a/drivers/gpu/drm/i915/gvt/aperture_gm.c
+++ b/drivers/gpu/drm/i915/gvt/aperture_gm.c
@@ -131,7 +131,7 @@ void intel_vgpu_write_fence(struct intel_vgpu *vgpu,
assert_rpm_wakelock_held(dev_priv);
- if (WARN_ON(fence > vgpu_fence_sz(vgpu)))
+ if (WARN_ON(fence >= vgpu_fence_sz(vgpu)))
return;
reg = vgpu->fence.regs[fence];