From: Michael Strauss Date: Wed, 13 Jan 2021 21:33:15 +0000 (-0500) Subject: drm/amd/display: Add null pointer check to is_dig_enabled func X-Git-Tag: baikal/aarch64/sdk6.1~7223^2~5^2~26 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=462fe9c29293ef3271af5b102f45139c51fcf1eb;p=kernel.git drm/amd/display: Add null pointer check to is_dig_enabled func [WHY] Safeguarding as pointer may be null in diagnostic environment Signed-off-by: Michael Strauss Reviewed-by: Sung Lee Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c index 991b9c5beaa30..aadb801447a7c 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c @@ -75,7 +75,8 @@ int vg_get_active_display_cnt_wa( const struct dc_link *link = dc->links[i]; /* abusing the fact that the dig and phy are coupled to see if the phy is enabled */ - if (link->link_enc->funcs->is_dig_enabled(link->link_enc)) + if (link->link_enc->funcs->is_dig_enabled && + link->link_enc->funcs->is_dig_enabled(link->link_enc)) display_count++; }