mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
Since commite7fa80e293("drm_gem: add mutex to drm_gem_object.gpuva") it is possible for test_prepare_array() to exceed a stack frame size of 2048 bytes depending on the exact configuration of the kernel. drivers/gpu/drm/tests/drm_exec_test.c: In function ‘test_prepare_array’: drivers/gpu/drm/tests/drm_exec_test.c:171:1: error: the frame size of 2128 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 171 | } | ^ cc1: all warnings being treated as errors make[6]: *** [scripts/Makefile.build:287: drivers/gpu/drm/tests/drm_exec_test.o] Error 1 make[6]: *** Waiting for unfinished jobs.... In order to fix this, allocate the GEM objects in test_prepare_array() with kzalloc(), rather than placing them on the stack. Cc: Alice Ryhl <aliceryhl@google.com> Cc: Christian König <christian.koenig@amd.com> Fixes:e7fa80e293("drm_gem: add mutex to drm_gem_object.gpuva") Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Nirmoy Das <nirmoyd@nvidia.com> Link: https://lore.kernel.org/r/20250829075633.2306-1-dakr@kernel.org [ Use kunit_kzalloc() instead of kzalloc(). - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>