drm/amdgpu: Off by one in dm_dmub_outbox1_low_irq()
authorjsg <jsg@openbsd.org>
Mon, 1 Aug 2022 16:17:17 +0000 (16:17 +0000)
committerjsg <jsg@openbsd.org>
Mon, 1 Aug 2022 16:17:17 +0000 (16:17 +0000)
From Dan Carpenter
ec9ec3bc08b18c5b1b2feafd306ea7c348013898 in linux 5.15.y/5.15.58
a35faec3db0e13aac8ea720bc1a3503081dd5a3d in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index a7ec346..a2d8e03 100644 (file)
@@ -757,7 +757,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)
                if (irq_params->irq_src == DC_IRQ_SOURCE_DMCUB_OUTBOX) {
                        do {
                                dc_stat_get_dmub_notification(adev->dm.dc, &notify);
-                               if (notify.type > ARRAY_SIZE(dm->dmub_thread_offload)) {
+                               if (notify.type >= ARRAY_SIZE(dm->dmub_thread_offload)) {
                                        DRM_ERROR("DM: notify type %d larger than the array size %ld !", notify.type,
                                        ARRAY_SIZE(dm->dmub_thread_offload));
                                        continue;