amdgpu_fence_driver_start_ring() attempts to access UVD instance 2 during setup, while the existing UVD instance count only allows instances 0 and 1. Increase AMDGPU_MAX_UVD_INSTANCES by one to avoid the invalid array access. Caught by UBSAN. Signed-off-by: Timothy Pearson <tpearson at raptorengineering.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h index 8b23a1b00c76..4a47cb570af7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h @@ -31,7 +31,7 @@ #define AMDGPU_UVD_SESSION_SIZE (50*1024) #define AMDGPU_UVD_FIRMWARE_OFFSET 256 -#define AMDGPU_MAX_UVD_INSTANCES 2 +#define AMDGPU_MAX_UVD_INSTANCES 3 #define AMDGPU_UVD_FIRMWARE_SIZE(adev) \ (AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(((const struct common_firmware_header *)(adev)->uvd.fw->data)->ucode_size_bytes) + \ -- 2.17.1