drm/amd/display: Fix incorrect size calculation for loop
authorAlex Hung <alex.hung@amd.com>
Sat, 20 Apr 2024 02:23:36 +0000 (20:23 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 May 2024 20:18:16 +0000 (16:18 -0400)
commit3941a3aa4b653b69876d894d08f3fff1cc965267
tree26e3ef66748b5dc60a9559f54b2c25dff110a382
parentcf8b16857db702ceb8d52f9219a4613363e2b1cf
drm/amd/display: Fix incorrect size calculation for loop

[WHY]
fe_clk_en has size of 5 but sizeof(fe_clk_en) has byte size 20 which is
lager than the array size.

[HOW]
Divide byte size 20 by its element size.

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/dccg/dcn35/dcn35_dccg.c