⬢ DragonFlyBSD Kernel Audit
DF-3600 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/amd/amdgpu/gfx_v8_0.c
+++ b/sys/dev/drm/amd/amdgpu/gfx_v8_0.c
@@ -6828,7 +6828,10 @@
 					REG_GET_FIELD(ih_data, SQ_INTERRUPT_WORD_WAVE, WAVE_ID),
 					REG_GET_FIELD(ih_data, SQ_INTERRUPT_WORD_WAVE, VM_ID),
 					REG_GET_FIELD(ih_data, SQ_INTERRUPT_WORD_WAVE, PRIV) ? "true" : "false",
-					(sq_edc_source != -1) ? sq_edc_source_names[sq_edc_source] : "unavailable"
+					(sq_edc_source >= 0 &&
+					 sq_edc_source < (int)ARRAY_SIZE(sq_edc_source_names))
+						? sq_edc_source_names[sq_edc_source]
+						: "unavailable"
 				);
 			break;
 		default: