dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [lvc-project] [PATCH] drm/amd/display: Fix potential null dereference
@ 2023-09-29 15:33 Igor Artemiev
  0 siblings, 0 replies; only message in thread
From: Igor Artemiev @ 2023-09-29 15:33 UTC (permalink / raw)
  To: Harry Wentland
  Cc: lvc-project, Leo Li, Pan, Xinhui, Rodrigo Siqueira, linux-kernel,
	amd-gfx, dri-devel, Alex Deucher, Igor Artemiev,
	Christian König

The 'top_pipe_to_program pointer' can be NULL and it is checked 
at the first dereference, but not at the second. 

Add a check before using it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 3a9077b60029..154ad23ff931 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3824,7 +3824,8 @@ static void commit_planes_for_stream(struct dc *dc,
 	}
 
 	if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed)
-		if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
+		if (top_pipe_to_program &&
+				top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) {
 			top_pipe_to_program->stream_res.tg->funcs->wait_for_state(
 				top_pipe_to_program->stream_res.tg,
 				CRTC_STATE_VACTIVE);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-29 15:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 15:33 [lvc-project] [PATCH] drm/amd/display: Fix potential null dereference Igor Artemiev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).