drm/amd/display: Fix Coverity INTERGER_OVERFLOW within construct_integrated_info

[ Upstream commit 176abbcc71 ]

[Why]
For substrcation, coverity reports integer overflow
warning message when variable type is uint32_t.

[How]
Change varaible type to int32_t.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Hersen Wu 2024-04-26 10:46:41 -04:00 committed by Greg Kroah-Hartman
parent cb63090a17
commit 13faa9d401
2 changed files with 7 additions and 4 deletions

View File

@ -2552,8 +2552,8 @@ static enum bp_result construct_integrated_info(
/* Sort voltage table from low to high*/ /* Sort voltage table from low to high*/
if (result == BP_RESULT_OK) { if (result == BP_RESULT_OK) {
uint32_t i; int32_t i;
uint32_t j; int32_t j;
for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) { for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
for (j = i; j > 0; --j) { for (j = i; j > 0; --j) {

View File

@ -2935,8 +2935,11 @@ static enum bp_result construct_integrated_info(
struct atom_common_table_header *header; struct atom_common_table_header *header;
struct atom_data_revision revision; struct atom_data_revision revision;
uint32_t i; int32_t i;
uint32_t j; int32_t j;
if (!info)
return result;
if (info && DATA_TABLES(integratedsysteminfo)) { if (info && DATA_TABLES(integratedsysteminfo)) {
header = GET_IMAGE(struct atom_common_table_header, header = GET_IMAGE(struct atom_common_table_header,