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>
This commit is contained in:
parent
af33c419c5
commit
b405fc64c5
1 changed files with 3 additions and 0 deletions
|
@ -1802,6 +1802,9 @@ static struct audio *find_first_free_audio(
|
|||
{
|
||||
int i, available_audio_count;
|
||||
|
||||
if (id == ENGINE_ID_UNKNOWN)
|
||||
return NULL;
|
||||
|
||||
available_audio_count = pool->audio_count;
|
||||
|
||||
for (i = 0; i < available_audio_count; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue