Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Avoid NULL pointer in set_backlight when ABM is NULL

[Why]
On ASIC without ABM support (most dGPU) we run into a null pointer
dereference when attempting to set the backlight level.

[How]
This function requires ABM, so fix up the condition to only allow
DMCU to be optional.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Wyatt Wood <Wyatt.Wood@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
f1029e7e 39063de9

+1 -2
+1 -2
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 2462 2462 int i; 2463 2463 DC_LOGGER_INIT(link->ctx->logger); 2464 2464 2465 - if ((dmcu == NULL && abm == NULL) || 2466 - (abm->funcs->set_backlight_level_pwm == NULL)) 2465 + if (abm == NULL || (abm->funcs->set_backlight_level_pwm == NULL)) 2467 2466 return false; 2468 2467 2469 2468 if (dmcu)