OSDN Git Service

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)
commit7fcffecf79ba2963f1f7cf967f451818a7913482
tree8ac17509ea4170453ba7e454fa41f3374745c7c5
parentbcb7b0ef828c21a0b629d6081c0827e71574d652
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: a0d254820f43 ("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