]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Fix incorrect size calculation for loop in dcn401
authorAlex Hung <alex.hung@amd.com>
Wed, 29 May 2024 20:08:44 +0000 (14:08 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:17:17 +0000 (16:17 -0400)
commitd281b7742662e199fbba57fbd86c6c2bdd73104a
tree075a307fa75ccafd72209897c3bc2f065a7e792b
parentdd9d8c61ccff0e3409b0bff702444f3d31684e9e
drm/amd/display: Fix incorrect size calculation for loop in dcn401

[WHY]
fe_clk_en and be_clk_sel have size of 4 but sizeof(fe_clk_en) has
byte size 16 which is lager than the array size.

[HOW]
Use ARRAY_SIZE for calculating size.

This fixes 2 OVERRUN issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Zaeem Mohamed <zaeem.mohamed@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/dcn401/dcn401_dccg.c