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>
This commit is contained in:
@@ -258,7 +258,7 @@ bool dmub_abm_set_pipe(struct abm *abm,
|
||||
{
|
||||
union dmub_rb_cmd cmd;
|
||||
struct dc_context *dc = abm->ctx;
|
||||
uint32_t ramping_boundary = 0xFFFF;
|
||||
uint8_t ramping_boundary = 0xFF;
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.abm_set_pipe.header.type = DMUB_CMD__ABM;
|
||||
|
||||
@@ -142,7 +142,7 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst,
|
||||
{
|
||||
union dmub_rb_cmd cmd;
|
||||
struct dc_context *dc = abm->ctx;
|
||||
uint32_t ramping_boundary = 0xFFFF;
|
||||
uint8_t ramping_boundary = 0xFF;
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.abm_set_pipe.header.type = DMUB_CMD__ABM;
|
||||
|
||||
Reference in New Issue
Block a user