* [PATCH] drm/amd/display: Check pipe_ctx before it is used
@ 2024-06-24 2:48 Ma Ke
2024-06-24 17:16 ` Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Ma Ke @ 2024-06-24 2:48 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
christian.koenig, Xinhui.Pan, airlied, daniel, wenjing.liu,
jun.lei, hamza.mahfooz, alex.hung, alvin.lee2, george.shen,
dillon.varone
Cc: amd-gfx, dri-devel, linux-kernel, Ma Ke
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/display: Check pipe_ctx before it is used
2024-06-24 2:48 [PATCH] drm/amd/display: Check pipe_ctx before it is used Ma Ke
@ 2024-06-24 17:16 ` Markus Elfring
2024-06-24 19:26 ` Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2024-06-24 17:16 UTC (permalink / raw)
To: Ma Ke, amd-gfx, dri-devel, Alex Deucher, Alex Hung, Alvin Lee,
Christian König, Daniel Vetter, David Airlie, Dillon Varone,
George Shen, Hamza Mahfooz, Harry Wentland, Jun Lei, Leo Li,
Rodrigo Siqueira, Wenjing Liu, Xinhui Pan
Cc: LKML, Aurabindo Pillai, Natanel Roizenman, Nicholas Kazlauskas
> 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().
A similar fix was integrated already according to a contribution
by Natanel Roizenman.
From which Linux version did you take source files for your static code analyses?
Please take another look at the corresponding software update.
[PATCH 16/37] drm/amd/display: Add null check in resource_log_pipe_topology_update
https://lore.kernel.org/amd-gfx/20240422152817.2765349-17-aurabindo.pillai@amd.com/
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/display: Check pipe_ctx before it is used
2024-06-24 17:16 ` Markus Elfring
@ 2024-06-24 19:26 ` Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2024-06-24 19:26 UTC (permalink / raw)
To: Ma Ke, amd-gfx, dri-devel, Alex Deucher, Alex Hung, Alvin Lee,
Christian König, Daniel Vetter, David Airlie, Dillon Varone,
George Shen, Hamza Mahfooz, Harry Wentland, Jun Lei, Leo Li,
Rodrigo Siqueira, Wenjing Liu, Xinhui Pan
Cc: LKML, Aurabindo Pillai, Hersen Wu, Natanel Roizenman,
Nicholas Kazlauskas, Tom Chung
>> 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().
>
> A similar fix was integrated already according to a contribution
> by Natanel Roizenman.
> From which Linux version did you take source files for your static code analyses?
>
> Please take another look at the corresponding software update.
> [PATCH 16/37] drm/amd/display: Add null check in resource_log_pipe_topology_update
> https://lore.kernel.org/amd-gfx/20240422152817.2765349-17-aurabindo.pillai@amd.com/
How “interesting” is it that a similar source code correction needed
to be repeated by Hersen Wu?
drm/amd/display: Add otg_master NULL check within resource_log_pipe_topology_update
https://lore.kernel.org/amd-gfx/20240501071651.3541919-31-chiahsuan.chung@amd.com/
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-24 19:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-24 2:48 [PATCH] drm/amd/display: Check pipe_ctx before it is used Ma Ke
2024-06-24 17:16 ` Markus Elfring
2024-06-24 19:26 ` Markus Elfring
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®