]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Avoid overflow from uint32_t to uint8_t
authorAlex Hung <alex.hung@amd.com>
Fri, 31 May 2024 17:51:26 +0000 (11:51 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jun 2024 20:18:26 +0000 (16:18 -0400)
commitd6b54900c564e35989cf6813e4071504fa0a90e0
treea83a5dba93d54e9ab5c9b6c38c23143c9ecf60c5
parentcc2b7387c132ebd51c7c5252cfcb494ac75ebf18
drm/amd/display: Avoid overflow from uint32_t to uint8_t

[WHAT & HOW]
dmub_rb_cmd's ramping_boundary has size of uint8_t and it is assigned
0xFFFF. Fix it by changing it to uint8_t with value of 0xFF.

This fixes 2 INTEGER_OVERFLOW issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@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/dce/dmub_abm_lcd.c
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c