]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/display: add NULL checks for clock manager pointer
authorAhzo <Ahzo@tutanota.com>
Fri, 11 Oct 2019 17:55:03 +0000 (19:55 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Oct 2019 19:55:32 +0000 (15:55 -0400)
This fixes kernel NULL pointer dereferences on shutdown:
RIP: 0010:build_audio_output.isra.0+0x97/0x110 [amdgpu]
RIP: 0010:enable_link_dp+0x186/0x300 [amdgpu]

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Ahzo <Ahzo@tutanota.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

index 25bce56216cd304d3225f9c40220846b859182da..fb18681b502b5f78f2c741b08b16a9bbbb0d56e7 100644 (file)
@@ -1529,7 +1529,7 @@ static enum dc_status enable_link_dp(
 
        pipe_ctx->stream_res.pix_clk_params.requested_sym_clk =
                        link_settings.link_rate * LINK_RATE_REF_FREQ_IN_KHZ;
-       if (!apply_seamless_boot_optimization)
+       if (state->clk_mgr && !apply_seamless_boot_optimization)
                state->clk_mgr->funcs->update_clocks(state->clk_mgr, state, false);
 
        dp_enable_link_phy(
index 021e406a0ca2499a7aff9ace059d400a182be280..9150e546dcf2dc784b6172a16e747150ac6a46e6 100644 (file)
@@ -1161,8 +1161,9 @@ static void build_audio_output(
                }
        }
 
-       if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
-                       pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
+       if (state->clk_mgr &&
+               (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
+                       pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)) {
                audio_output->pll_info.dp_dto_source_clock_in_khz =
                                state->clk_mgr->funcs->get_dp_ref_clk_frequency(
                                                state->clk_mgr);