[PATCH 6.12 308/466] drm/amd/display: Adding array index check to prevent memory corruption