Skip to content

Commit b719a9c

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: Fix NULL pointer dereference at hibernate
During hibernate sequence the source context might not have a clk_mgr. So don't use it to look for DML2 support. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2980 Fixes: 7966f31 ("drm/amd/display: Introduce DML2") Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 71225e1 commit b719a9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4554,15 +4554,15 @@ void dc_resource_state_copy_construct(
45544554
struct dml2_context *dml2 = NULL;
45554555

45564556
// Need to preserve allocated dml2 context
4557-
if (src_ctx->clk_mgr->ctx->dc->debug.using_dml2)
4557+
if (src_ctx->clk_mgr && src_ctx->clk_mgr->ctx->dc->debug.using_dml2)
45584558
dml2 = dst_ctx->bw_ctx.dml2;
45594559
#endif
45604560

45614561
*dst_ctx = *src_ctx;
45624562

45634563
#ifdef CONFIG_DRM_AMD_DC_FP
45644564
// Preserve allocated dml2 context
4565-
if (src_ctx->clk_mgr->ctx->dc->debug.using_dml2)
4565+
if (src_ctx->clk_mgr && src_ctx->clk_mgr->ctx->dc->debug.using_dml2)
45664566
dst_ctx->bw_ctx.dml2 = dml2;
45674567
#endif
45684568

0 commit comments

Comments
 (0)