Skip to content

Commit 0726ed3

Browse files
Yizhuo Zhaialexdeucher
authored andcommitted
drm/amd/display: Fix the uninitialized variable in enable_stream_features()
In function enable_stream_features(), the variable "old_downspread.raw" could be uninitialized if core_link_read_dpcd() fails, however, it is used in the later if statement, and further, core_link_write_dpcd() may write random value, which is potentially unsafe. Fixes: 6016cd9 ("drm/amd/display: add helper for enabling mst stream features") Cc: stable@vger.kernel.org Signed-off-by: Yizhuo Zhai <yzhai003@ucr.edu> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 937ed9c commit 0726ed3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/core/dc_link.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx)
18181818
union down_spread_ctrl old_downspread;
18191819
union down_spread_ctrl new_downspread;
18201820

1821+
memset(&old_downspread, 0, sizeof(old_downspread));
1822+
18211823
core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
18221824
&old_downspread.raw, sizeof(old_downspread));
18231825

0 commit comments

Comments
 (0)