drm/amd/display: Fix the uninitialized variable in enable_stream_features()
authorYizhuo Zhai <yzhai003@ucr.edu>
Sat, 18 Dec 2021 04:22:23 +0000 (20:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:05:11 +0000 (11:05 +0100)
commit3bf997ec299cdf7280b2039806e5e1d847df111a
tree979ae3cc1bf9dc58f3e208c17a49df72d82000d4
parent2de6ce5836513f0bfe61d0948d8eb25f1417e7bd
drm/amd/display: Fix the uninitialized variable in enable_stream_features()

commit 0726ed3065eeb910f9cea0c933bc021a848e00b3 upstream.

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: 6016cd9dba0f ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/dc/core/dc_link.c