]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10
authorErnst Sjöstrand <ernstp@gmail.com>
Thu, 2 Sep 2021 07:50:27 +0000 (09:50 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Sep 2021 20:14:41 +0000 (16:14 -0400)
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 <ernstp@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h

index dc3c6b3a00e531f2e325b59de35db3804bf6b6f3..d356e329e6f89e19f7af3c03f4268f0fa934dfc1 100644 (file)
@@ -758,7 +758,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;