drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT
authorHarry Wentland <harry.wentland@amd.com>
Tue, 19 Apr 2022 17:03:12 +0000 (13:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 4 May 2022 16:21:41 +0000 (12:21 -0400)
commit3dfe85fa87b2a26bdbd292b66653bba065cf9941
tree7d85235b7042fd3d3281121d7cecf8f1b2b63a68
parent19965d8259fdabc6806da92adda49684f5bcbec5
drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT

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
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c