diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-02-02 03:30:25 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-02-02 03:30:25 +0000 |
commit | 1af831fc62acb94bdc3963f0b23413ad959977ac (patch) | |
tree | 3b738924a180f67d61f2038f297465ee189a1b91 /sys/dev | |
parent | 5185c3301a8b9eb7616c9c43a9a1067d6c5c936f (diff) |
drm/amd/display: Fix late derefrence 'dsc' check in 'link_set_dsc_pps_packet()'
From Srinivasan Shanmugam
6aa5ede6665122f4c8abce3c6eba06b49e54d25c in linux-6.6.y/6.6.15
3bb9b1f958c3d986ed90a3ff009f1e77e9553207 in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/amd/display/dc/link/link_dpms.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c b/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c index f2f3ba15be7..87a2f12aeb4 100644 --- a/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c +++ b/sys/dev/pci/drm/amd/display/dc/link/link_dpms.c @@ -873,11 +873,15 @@ bool link_set_dsc_pps_packet(struct pipe_ctx *pipe_ctx, bool enable, bool immedi { struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc; struct dc_stream_state *stream = pipe_ctx->stream; - DC_LOGGER_INIT(dsc->ctx->logger); - if (!pipe_ctx->stream->timing.flags.DSC || !dsc) + if (!pipe_ctx->stream->timing.flags.DSC) return false; + if (!dsc) + return false; + + DC_LOGGER_INIT(dsc->ctx->logger); + if (enable) { struct dsc_config dsc_cfg; uint8_t dsc_packed_pps[128]; |