From: Ma Ke <make24@iscas.ac.cn>
To: harry.wentland@amd.com, sunpeng.li@amd.com,
Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
daniel@ffwll.ch, wenjing.liu@amd.com, jun.lei@amd.com,
hamza.mahfooz@amd.com, alex.hung@amd.com, alvin.lee2@amd.com,
george.shen@amd.com, dillon.varone@amd.com
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Ma Ke <make24@iscas.ac.cn>
Subject: [PATCH] drm/amd/display: Check pipe_ctx before it is used
Date: Mon, 24 Jun 2024 10:48:35 +0800 [thread overview]
Message-ID: <20240624024835.2278651-1-make24@iscas.ac.cn> (raw)
resource_get_otg_master_for_stream() could return NULL, we
should check the return value of 'otg_master' before it is
used in resource_log_pipe_for_stream().
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 15819416a2f3..597ca9f369c6 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2279,6 +2279,8 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state)
state->stream_status[stream_idx].mall_stream_config.paired_stream);
otg_master = resource_get_otg_master_for_stream(
&state->res_ctx, state->streams[phantom_stream_idx]);
+ if (!otg_master)
+ continue;
resource_log_pipe_for_stream(dc, state, otg_master, stream_idx);
}
}
--
2.25.1
next reply other threads:[~2024-06-24 2:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 2:48 Ma Ke [this message]
2024-06-24 17:16 ` Markus Elfring
2024-06-24 19:26 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240624024835.2278651-1-make24@iscas.ac.cn \
--to=make24@iscas.ac.cn \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alex.hung@amd.com \
--cc=alexander.deucher@amd.com \
--cc=alvin.lee2@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dillon.varone@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=george.shen@amd.com \
--cc=hamza.mahfooz@amd.com \
--cc=harry.wentland@amd.com \
--cc=jun.lei@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sunpeng.li@amd.com \
--cc=wenjing.liu@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®