Colin Ian King 8e60b7f195 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 <colin.king@canonical.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
2017-12-05 11:45:06 +08:00
..
2017-12-04 11:24:33 +08:00
2017-12-04 11:24:33 +08:00
2016-10-14 18:15:25 +08:00
2017-12-04 11:24:33 +08:00
2017-12-04 11:24:33 +08:00
2017-12-04 11:24:32 +08:00
2017-11-16 11:48:22 +08:00
2016-10-14 18:12:11 +08:00
2017-12-04 11:24:33 +08:00