]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: Skip finding free audio for unknown engine_id
authorAlex Hung <alex.hung@amd.com>
Mon, 22 Apr 2024 19:52:27 +0000 (13:52 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jul 2024 10:49:05 +0000 (12:49 +0200)
commit95ad20ee3c4efbb91f9a4ab08e070aa3697f5879
tree8c43454eeaab24886eb1cdc71adebe7744a22d2e
parent96bf81cc1bd058bb8af6e755a548e926e934dfd1
drm/amd/display: Skip finding free audio for unknown engine_id

[ Upstream commit 1357b2165d9ad94faa4c4a20d5e2ce29c2ff29c3 ]

[WHY]
ENGINE_ID_UNKNOWN = -1 and can not be used as an array index. Plus, it
also means it is uninitialized and does not need free audio.

[HOW]
Skip and return NULL.

This fixes 2 OVERRUN issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c