aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Kazlauskas <[email protected]>2020-04-02 15:59:44 -0400
committerAlex Deucher <[email protected]>2020-04-22 18:11:47 -0400
commitf1029e7ead9a5f13ef040dfbe1473b975f927b41 (patch)
tree89ea13263d3f1e6709194dc55c38cb4673b41ccb
parent39063de95cfb1d522d111bdba10441bcd5642a43 (diff)
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 <[email protected]> Reviewed-by: Wyatt Wood <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_link.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 1c5c11d6347e..a926c1c3f57d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -2462,8 +2462,7 @@ bool dc_link_set_backlight_level(const struct dc_link *link,
int i;
DC_LOGGER_INIT(link->ctx->logger);
- if ((dmcu == NULL && abm == NULL) ||
- (abm->funcs->set_backlight_level_pwm == NULL))
+ if (abm == NULL || (abm->funcs->set_backlight_level_pwm == NULL))
return false;
if (dmcu)