mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
drm/amd/display: Fix for NULL ramp pointer crashing driver
[Why] In certain scenarios the ramp parameter come in as NULL, which crashes because this function doesn't guard properly in the early return. [How] - parameter mapUserRamp should be the guard (false means no ramp) - remove checking ramp in early return Signed-off-by: Joshua Aberback <joshua.aberback@amd.com> Reviewed-by: Sivapiriyan Kumarasamy <Sivapiriyan.Kumarasamy@amd.com> Acked-by: Eryk Brol <Eryk.Brol@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ffb6c1c6c5
commit
7eb9097541
|
|
@ -1772,8 +1772,7 @@ bool mod_color_calculate_degamma_params(struct dc_transfer_func *input_tf,
|
|||
/* we can use hardcoded curve for plain SRGB TF */
|
||||
if (input_tf->type == TF_TYPE_PREDEFINED &&
|
||||
input_tf->tf == TRANSFER_FUNCTION_SRGB &&
|
||||
(!mapUserRamp &&
|
||||
(ramp->type == GAMMA_RGB_256 || ramp->num_entries == 0)))
|
||||
!mapUserRamp)
|
||||
return true;
|
||||
|
||||
input_tf->type = TF_TYPE_DISTRIBUTED_POINTS;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user