Commit 0726ed30 authored by Yizhuo Zhai's avatar Yizhuo Zhai Committed by Alex Deucher

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: 6016cd9d ("drm/amd/display: add helper for enabling mst stream features")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarYizhuo Zhai <yzhai003@ucr.edu>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 937ed9c8
......@@ -1818,6 +1818,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx)
union down_spread_ctrl old_downspread;
union down_spread_ctrl new_downspread;
memset(&old_downspread, 0, sizeof(old_downspread));
core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
&old_downspread.raw, sizeof(old_downspread));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment