]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amd/display: Ensure array index tg_inst won't be -1
authorAlex Hung <alex.hung@amd.com>
Tue, 16 Apr 2024 22:44:17 +0000 (16:44 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 May 2024 20:18:16 +0000 (16:18 -0400)
commit687fe329f18ab0ab0496b20ed2cb003d4879d931
tree8da5639af74e152fd538b70513c7a421e0012495
parent9419da172221eb1dd672bcbaa2e27bb5f8ca807a
drm/amd/display: Ensure array index tg_inst won't be -1

[WHY & HOW]
tg_inst will be a negative if timing_generator_count equals 0, which
should be checked before used.

This fixes 2 OVERRUN issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c