summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests
diff options
context:
space:
mode:
authorArthur Grillo <arthurgrillo@riseup.net>2023-09-01 21:52:56 +0300
committerMaíra Canal <mairacanal@riseup.net>2023-09-08 23:38:19 +0300
commitfb0a84e6de1b6bee0a0649cc7ed768f9ff2496bb (patch)
tree9f59e4647e4446661356d0f7875ed2d5d48ad9fd /drivers/gpu/drm/tests
parentb88c168e6b91eefde1ba4cba19b0f3e3d735c3d2 (diff)
downloadlinux-fb0a84e6de1b6bee0a0649cc7ed768f9ff2496bb.tar.xz
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: 371e0b186a13 ("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
Diffstat (limited to 'drivers/gpu/drm/tests')
-rw-r--r--drivers/gpu/drm/tests/drm_format_helper_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tests/drm_format_helper_test.c b/drivers/gpu/drm/tests/drm_format_helper_test.c
index 79bc9d4bbd71..1a6bd291345d 100644
--- a/drivers/gpu/drm/tests/drm_format_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_format_helper_test.c
@@ -1165,7 +1165,7 @@ KUNIT_ARRAY_PARAM(fb_build_fourcc_list, fb_build_fourcc_list_cases, fb_build_fou
static void drm_test_fb_build_fourcc_list(struct kunit *test)
{
const struct fb_build_fourcc_list_case *params = test->param_value;
- u32 fourccs_out[TEST_BUF_SIZE];
+ u32 fourccs_out[TEST_BUF_SIZE] = {0};
size_t nfourccs_out;
struct drm_device *drm;
struct device *dev;