drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 13 Apr 2017 19:48:28 +0000 (22:48 +0300)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 18 Apr 2017 09:50:05 +0000 (17:50 +0800)
commitc821ee6d2bb4cfc9991bf285f53103cde9d3593a
tree6cbf86111841e1a988f5789dce28ebd2ebb70998
parent5ad59bf0960b807f01cb6ef8c54f68b3476a1546
drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()

There are two bugs here.  The && should be || and the > is off by one so
it should be >= ARRAY_SIZE().

Fixes: 8453d674ae7e ("drm/i915/gvt: vGPU execlist virtualization")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/execlist.c