aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/link/link_validation.c
diff options
context:
space:
mode:
authorSohaib Nadeem <sohaib.nadeem@amd.com>2024-01-31 16:40:37 -0500
committerAlex Deucher <alexander.deucher@amd.com>2024-02-14 17:13:28 -0500
commit616b39467e816851335277d817ec98b7a9b92758 (patch)
tree79a8ed1b4395d7afdd0af9bbc89382fb9082b481 /drivers/gpu/drm/amd/display/dc/link/link_validation.c
parentdrm/amd/display: Fix array-index-out-of-bounds in dcn35_clkmgr (diff)
downloadlinux-616b39467e816851335277d817ec98b7a9b92758.tar.gz
linux-616b39467e816851335277d817ec98b7a9b92758.zip
drm/amd/display: fixed integer types and null check locations
[why]: issues fixed: - comparison with wider integer type in loop condition which can cause infinite loops - pointer dereference before null check Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Josip Pavic <josip.pavic@amd.com> Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Sohaib Nadeem <sohaib.nadeem@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/link/link_validation.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/link/link_validation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_validation.c b/drivers/gpu/drm/amd/display/dc/link/link_validation.c
index 1c038e2a527b..1aed55b0ab6a 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_validation.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_validation.c
@@ -359,7 +359,7 @@ bool link_validate_dpia_bandwidth(const struct dc_stream_state *stream, const un
struct dc_link *dpia_link[MAX_DPIA_NUM] = {0};
int num_dpias = 0;
- for (uint8_t i = 0; i < num_streams; ++i) {
+ for (unsigned int i = 0; i < num_streams; ++i) {
if (stream[i].signal == SIGNAL_TYPE_DISPLAY_PORT) {
/* new dpia sst stream, check whether it exceeds max dpia */
if (num_dpias >= MAX_DPIA_NUM)