drm/amd: Init modifier field of helper fb.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 16 May 2018 00:40:23 +0000 (02:40 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Oct 2020 18:27:22 +0000 (14:27 -0400)
Otherwise the field ends up being used uninitialized when
enabling modifiers, failing validation with high likelyhood.

v4: Use memset

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(for v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c

index e2c2eb4..0bf7d36 100644 (file)
@@ -207,6 +207,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
        int ret;
        unsigned long tmp;
 
+       memset(&mode_cmd, 0, sizeof(mode_cmd));
        mode_cmd.width = sizes->surface_width;
        mode_cmd.height = sizes->surface_height;