drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()
PATCH 1/1 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().
drivers/gpu/drm/i915/gvt/execlist.c +2 -2
@@ -56,8 +56,8 @@ static int context_switch_events[] = {static int ring_id_to_context_switch_event (int ring_id) { -if (WARN_ON (ring_id <RCS && ring_id > -ARRAY_SIZE (context_switch_events))) +if (WARN_ON (ring_id <RCS || + ring_id >=ARRAY_SIZE (context_switch_events)))return -EINVAL ;return context_switch_events[ring_id];
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()
== Series Details ==
== Series Details ==
Series: drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()
URL : https://patchwork.freedesktop.org/series/23036/
State : success
== Summary ==
Series 23036v1 drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()
https://patchwork.freedesktop.org/api/1.0/series/23036/revisions/1/mbox/
Test drv_module_reload:
Subgroup basic-reload-final:
pass -> DMESG-WARN (fi-skl-6770hq) fdo#100248
Test gem_exec_suspend:
Subgroup basic-s4-devices:
dmesg-warn -> PASS (fi-kbl-7560u) fdo#100125fdo#100248 https://bugs.freedesktop.org/show_bug.cgi?id=100248
fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time:430s fi-bdw-gvtdvm total:278 pass:256 dwarn:8 dfail:0 fail:0 skip:14 time:424s fi-bsw-n3050 total:278 pass:242 dwarn:0 dfail:0 fail:0 skip:36 time:568s fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time:511s fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time:545s fi-byt-j1900 total:278 pass:254 dwarn:0 dfail:0 fail:0 skip:24 time:489s fi-byt-n2820 total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time:484s fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time:407s fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time:404s fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time:417s fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:492s fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:473s fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time:457s fi-kbl-7560u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time:570s fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time:446s fi-skl-6700hq total:278 pass:261 dwarn:0 dfail:0 fail:0 skip:17 time:572s fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time:461s fi-skl-6770hq total:278 pass:267 dwarn:1 dfail:0 fail:0 skip:10 time:491s fi-skl-gvtdvm total:278 pass:265 dwarn:0 dfail:0 fail:0 skip:13 time:435s fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time:528s fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time:406s
0a54b7fee9ecda9257d34e5c3ac8de6516a60a90 drm-tip: 2017y-04m-13d-19h-12m-59s UTC integration manifest d124ee0 drm/i915/gvt: fix a bounds check in ring_id_to_context_switch_event()
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4504/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx