diff options
| author | Colin Ian King <[email protected]> | 2017-12-04 17:21:06 +0000 |
|---|---|---|
| committer | Zhenyu Wang <[email protected]> | 2017-12-05 03:45:06 +0000 |
| commit | 8e60b7f195d2536b2f090ae97f74ed19a504d60c (patch) | |
| tree | 99f658fc76da1f6404dbdc9a529ccf11bd7a0906 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | drm/i915/gvt: Add missing breaks in switch statement (diff) | |
| download | kernel-8e60b7f195d2536b2f090ae97f74ed19a504d60c.tar.gz kernel-8e60b7f195d2536b2f090ae97f74ed19a504d60c.zip | |
drm/i915/gvt: fix off-by-one comparison of ring_id
The ring_id maximum boundary is being compared using the > operator
instead of >=, leading to an off-by-one error and an out of bounds
write into array vgpu->hws_pga[]. Fix this by simply using the
correct comparison operator. Also re-work another comparison that
uses the comparison > I915_NUM_ENGINES - 1 to use the >= idiom using
to keep this consistent in this code.
Detected by CoverityScan, CID#1462404 ("Out-of-bounds write")
Fixes: a2ae95af9646 ("drm/i915/gvt: update CSB and CSB write pointer in virtual HWSP")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions
