]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool'
authorAnson Jacob <Anson.Jacob@amd.com>
Tue, 2 Mar 2021 21:16:36 +0000 (16:16 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:59:41 +0000 (10:59 +0200)
commitce6785cbc87d10e23e6a2bd93bef68aab6f20423
tree56aca8933830761f09b9d51343c5d3678c1fe433
parentdf6e8d7076a747eb2a345ea4f905751a34544a7d
drm/amd/display: Fix UBSAN warning for not a valid value for type '_Bool'

BugLink: https://bugs.launchpad.net/bugs/1928825
[ Upstream commit 6a30a92997eee49554f72b462dce90abe54a496f ]

[Why]
dc_cursor_position do not initialise position.translate_by_source when
crtc or plane->state->fb is NULL. UBSAN caught this error in
dce110_set_cursor_position, as the value was garbage.

[How]
Initialise dc_cursor_position structure elements to 0 in handle_cursor_update
before calling get_cursor_position.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1471
Reported-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Anson Jacob <Anson.Jacob@amd.com>
Reviewed-by: Aurabindo Jayamohanan Pillai <Aurabindo.Pillai@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c