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)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 26 Apr 2024 21:22:44 +0000 (17:22 -0400)
commit1357b2165d9ad94faa4c4a20d5e2ce29c2ff29c3
treeff642d0028ca4ea134b9d62cc10a46f64782c3dd
parent5396a70e8cf462ec5ccf2dc8de103c79de9489e6
drm/amd/display: Skip finding free audio for unknown engine_id

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