From: Charlene Liu Date: Sat, 20 May 2023 00:43:30 +0000 (-0400) Subject: drm/amd/display: add NULL pointer check X-Git-Tag: v6.5-rc1~153^2~7^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=389c6b3e120303715c018d1bfc7bab02b50ca3f4;p=thirdparty%2Fkernel%2Fstable.git drm/amd/display: add NULL pointer check [why] check dmub_Srv exist or not before accessing dmub. Acked-by: Stylon Wang Signed-off-by: Charlene Liu Reviewed-by: Zhan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c index 0d3ec50b13851..6e11d2b701f82 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c @@ -276,8 +276,8 @@ static void program_cursor_attributes( } dc->hwss.set_cursor_attribute(pipe_ctx); - - dc_send_update_cursor_info_to_dmu(pipe_ctx, i); + if (dc->ctx->dmub_srv) + dc_send_update_cursor_info_to_dmu(pipe_ctx, i); if (dc->hwss.set_cursor_sdr_white_level) dc->hwss.set_cursor_sdr_white_level(pipe_ctx); } @@ -396,8 +396,8 @@ static void program_cursor_position( } dc->hwss.set_cursor_position(pipe_ctx); - - dc_send_update_cursor_info_to_dmu(pipe_ctx, i); + if (dc->ctx->dmub_srv) + dc_send_update_cursor_info_to_dmu(pipe_ctx, i); } if (pipe_to_program)