summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-02-02 03:23:34 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-02-02 03:23:34 +0000
commitde1118c2e001acac9e48f291ebc2c2b4a1bf77c2 (patch)
tree19524b993e9bd5eaf2a01e69562c74a2f7315f09 /sys
parent42037845e6e85480536dbd0d063873dd3bd2a99d (diff)
drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay()
From Srinivasan Shanmugam 22ae604aea14756954e1c00ae653e34d2afd2935 in linux-6.6.y/6.6.15 7073934f5d73f8b53308963cee36f0d389ea857c in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/display/dc/link/protocols/link_edp_panel_control.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/link/protocols/link_edp_panel_control.c b/sys/dev/pci/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
index 13c3d7ff613..6f64aab18f0 100644
--- a/sys/dev/pci/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
+++ b/sys/dev/pci/drm/amd/display/dc/link/protocols/link_edp_panel_control.c
@@ -920,8 +920,8 @@ bool edp_get_replay_state(const struct dc_link *link, uint64_t *state)
bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream)
{
/* To-do: Setup Replay */
- struct dc *dc = link->ctx->dc;
- struct dmub_replay *replay = dc->res_pool->replay;
+ struct dc *dc;
+ struct dmub_replay *replay;
int i;
unsigned int panel_inst;
struct replay_context replay_context = { 0 };
@@ -937,6 +937,10 @@ bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream
if (!link)
return false;
+ dc = link->ctx->dc;
+
+ replay = dc->res_pool->replay;
+
if (!replay)
return false;
@@ -965,8 +969,7 @@ bool edp_setup_replay(struct dc_link *link, const struct dc_stream_state *stream
replay_context.line_time_in_ns = lineTimeInNs;
- if (replay)
- link->replay_settings.replay_feature_enabled =
+ link->replay_settings.replay_feature_enabled =
replay->funcs->replay_copy_settings(replay, link, &replay_context, panel_inst);
if (link->replay_settings.replay_feature_enabled) {