Skip to content

Commit fb0a84e

Browse files
Grillo-0mairacanal
authored andcommitted
drm/tests: Zero initialize fourccs_out
fourccs_out array is not initialized. As the drm_fb_build_fourcc_list() doesn't necessarily change all the array, and the test compares all of it, the comparison could fail if the array is not initialized. Zero initialize the array to fix this. Fixes: 371e0b1 ("drm/tests: Add KUnit tests for drm_fb_build_fourcc_list()") Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> Reviewed-by: Maíra Canal <mairacanal@riseup.net> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230901-zero-init-fourcc-list-test-v1-1-68bc4cc738c8@riseup.net
1 parent b88c168 commit fb0a84e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/tests/drm_format_helper_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ KUNIT_ARRAY_PARAM(fb_build_fourcc_list, fb_build_fourcc_list_cases, fb_build_fou
11651165
static void drm_test_fb_build_fourcc_list(struct kunit *test)
11661166
{
11671167
const struct fb_build_fourcc_list_case *params = test->param_value;
1168-
u32 fourccs_out[TEST_BUF_SIZE];
1168+
u32 fourccs_out[TEST_BUF_SIZE] = {0};
11691169
size_t nfourccs_out;
11701170
struct drm_device *drm;
11711171
struct device *dev;

0 commit comments

Comments
 (0)