]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: allocate large structures dynamically
authorArnd Bergmann <arnd@arndb.de>
Tue, 5 May 2020 14:01:52 +0000 (16:01 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 May 2020 17:12:55 +0000 (13:12 -0400)
commitffcf0a931eee305302a6e26160498dd80040b7c9
tree8ac17509ea4170453ba7e454fa41f3374745c7c5
parentced0a202530bccac39a5745c300cdf98fc458d86
drm/amdgpu: allocate large structures dynamically

After the structure was padded to 1024 bytes, it is no longer
suitable for being a local variable, as the function surpasses
the warning limit for 32-bit architectures:

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:587:5: error: stack frame size of 1072 bytes in function 'amdgpu_ras_feature_enable' [-Werror,-Wframe-larger-than=]
int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
    ^

Use kzalloc() instead to get it from the heap.

Fixes: 32a4fb27818b ("drm/amdgpu: update RAS TA to Host interface")
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c