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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:30:03 +0000 (12:30 +0200)
commitc10bab89a1bea395b2f6970529e38bef54ebf792
tree736be7d8b6d909cf6082c32865439eeeefbae074
parent2c14dda7a4dfecbda191351da29e4756b7377ee7
drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT

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