From: Ernst Sjöstrand Date: Thu, 2 Sep 2021 07:50:27 +0000 (+0200) Subject: drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10 X-Git-Tag: baikal/aarch64/sdk5.9~6848 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=e05550bec7d8a1341fe70ad19cc8907814c0624e;p=kernel.git drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10 commit 67a44e659888569a133a8f858c8230e9d7aad1d5 upstream. Seems like newer cards can have even more instances now. Found by UBSAN: array-index-out-of-bounds in drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:318:29 index 8 is out of range for type 'uint32_t *[8]' Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1697 Cc: stable@vger.kernel.org Signed-off-by: Ernst Sjöstrand Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index d1e278e999eeb..1b2fa83798304 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -762,7 +762,7 @@ enum amd_hw_ip_block_type { MAX_HWIP }; -#define HWIP_MAX_INSTANCE 8 +#define HWIP_MAX_INSTANCE 10 struct amd_powerplay { void *pp_handle;