You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT
commit 3dfe85fa87 upstream.
A faulty receiver might report an erroneous channel count. We
should guard against reading beyond AUDIO_CHANNELS_COUNT as
that would overflow the dpcd_pattern_period array.
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2e6f3d665a
commit
466721d767
@@ -2822,7 +2822,7 @@ static void dp_test_get_audio_test_data(struct dc_link *link, bool disable_video
|
||||
&dpcd_pattern_type.value,
|
||||
sizeof(dpcd_pattern_type));
|
||||
|
||||
channel_count = dpcd_test_mode.bits.channel_count + 1;
|
||||
channel_count = min(dpcd_test_mode.bits.channel_count + 1, AUDIO_CHANNELS_COUNT);
|
||||
|
||||
// read pattern periods for requested channels when sawTooth pattern is requested
|
||||
if (dpcd_pattern_type.value == AUDIO_TEST_PATTERN_SAWTOOTH ||
|
||||
|
||||
Reference in New Issue
Block a user