drm/amd/display: Check correct bounds for stream encoder instances for DCN303
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Tue, 26 Jul 2022 17:13:27 +0000 (13:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:39:55 +0000 (11:39 +0200)
commit82a27c1855445d48aacc67b0c0640f3dadebe52f
tree100ec5f12c612611f10f6a046e5e4590d5bcb74b
parent76672cd326c146ded2c2712ff257b8908dcf23d8
drm/amd/display: Check correct bounds for stream encoder instances for DCN303

commit 89b008222c2bf21e50219725caed31590edfd9d1 upstream.

[Why & How]
eng_id for DCN303 cannot be more than 1, since we have only two
instances of stream encoders.

Check the correct boundary condition for engine ID for DCN303 prevent
the potential out of bounds access.

Fixes: cd6d421e3d1a ("drm/amd/display: Initial DC support for Beige Goby")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@vger.kernel.org
Reviewed-by: Chris Park <Chris.Park@amd.com>
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c