Commit 4d06ccd0 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Fix access of wrong array element TF format conversion

Found by smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:357
convert_to_custom_float() error: buffer overflow 'arr_points' 2 <= 2
drivers/gpu/drm/amd/amdgpu/../display/dc/dce110/dce110_hw_sequencer.c:358
convert_to_custom_float() warn: buffer overflow 'arr_points' 2 <= 2

Regression:
drm/amd/display: Remove extra arr_points element
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 77bb51eb
...@@ -354,8 +354,8 @@ static bool convert_to_custom_float(struct pwl_result_data *rgb_resulted, ...@@ -354,8 +354,8 @@ static bool convert_to_custom_float(struct pwl_result_data *rgb_resulted,
return false; return false;
} }
if (!convert_to_custom_float_format(arr_points[2].slope, &fmt, if (!convert_to_custom_float_format(arr_points[1].slope, &fmt,
&arr_points[2].custom_float_slope)) { &arr_points[1].custom_float_slope)) {
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment