Skip to content

Commit c36e922

Browse files
Natanel Roizenmangregkh
authored andcommitted
drm/amd/display: Add null check in resource_log_pipe_topology_update
commit 899d92f upstream. [WHY] When switching from "Extend" to "Second Display Only" we sometimes call resource_get_otg_master_for_stream on a stream for the eDP, which is disconnected. This leads to a null pointer dereference. [HOW] Added a null check in dc_resource.c/resource_log_pipe_topology_update. CC: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Natanel Roizenman <natanel.roizenman@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7f71acd commit c36e922

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2267,6 +2267,10 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state)
22672267

22682268
otg_master = resource_get_otg_master_for_stream(
22692269
&state->res_ctx, state->streams[stream_idx]);
2270+
2271+
if (!otg_master)
2272+
continue;
2273+
22702274
resource_log_pipe_for_stream(dc, state, otg_master, stream_idx);
22712275
}
22722276
if (state->phantom_stream_count > 0) {

0 commit comments

Comments
 (0)