amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Alex Hung <alex.hung@amd.com>,
	Rodrigo Siqueira <rodrigo.siqueira@amd.com>,
	Jerry Zuo <jerry.zuo@amd.com>,
	Daniel Wheeler <daniel.wheeler@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	harry.wentland@amd.com, sunpeng.li@amd.com,
	Rodrigo.Siqueira@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
	wenjing.liu@amd.com, alvin.lee2@amd.com, george.shen@amd.com,
	dillon.varone@amd.com, aurabindo.pillai@amd.com,
	gabe.teeger@amd.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.11 182/244] drm/amd/display: Check stream before comparing them
Date: Wed, 25 Sep 2024 07:26:43 -0400	[thread overview]
Message-ID: <20240925113641.1297102-182-sashal@kernel.org> (raw)
In-Reply-To: <20240925113641.1297102-1-sashal@kernel.org>

From: Alex Hung <alex.hung@amd.com>

[ Upstream commit 35ff747c86767937ee1e0ca987545b7eed7a0810 ]

[WHAT & HOW]
amdgpu_dm can pass a null stream to dc_is_stream_unchanged. It is
necessary to check for null before dereferencing them.

This fixes 1 FORWARD_NULL issue reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 67794497457d3..913adca531fc4 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -3241,6 +3241,8 @@ static bool are_stream_backends_same(
 bool dc_is_stream_unchanged(
 	struct dc_stream_state *old_stream, struct dc_stream_state *stream)
 {
+	if (!old_stream || !stream)
+		return false;
 
 	if (!are_stream_backends_same(old_stream, stream))
 		return false;
-- 
2.43.0


  parent reply	other threads:[~2024-09-25 11:48 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240925113641.1297102-1-sashal@kernel.org>
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 130/244] drm/amd/display: Pass non-null to dcn20_validate_apply_pipe_split_flags Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 131/244] drm/amd/display: Check null pointers before using them Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 132/244] drm/amd/display: Check null pointers before used Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 133/244] drm/amd/display: Check null pointers before multiple uses Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 134/244] drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 135/244] drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 136/244] drm/amd/display: Add null check for head_pipe in dcn201_acquire_free_pipe_for_layer Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 137/244] drm/amd/display: Add null check for head_pipe in dcn32_acquire_idle_pipe_for_head_pipe_in_layer Sasha Levin
2024-09-25 11:25 ` [PATCH AUTOSEL 6.11 138/244] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn30_init_hw Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 139/244] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn401_init_hw Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 140/244] drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 142/244] drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 143/244] drm/amd/display: Add null check for top_pipe_to_program in commit_planes_for_stream Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 144/244] drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 150/244] drm/amd/display: Underflow Seen on DCN401 eGPU Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 151/244] drm/amd/display: Handle null 'stream_status' in 'planes_changed_for_existing_stream' Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 152/244] drm/amd/display: Add NULL check for function pointer in dcn20_set_output_transfer_func Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 153/244] drm/amd/display: Add NULL check for function pointer in dcn401_set_output_transfer_func Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 154/244] drm/amd/display: Add NULL check for function pointer in dcn32_set_output_transfer_func Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 155/244] drm/amd/display: fix a UBSAN warning in DML2.1 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 156/244] drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor (v2) Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 157/244] drm/amd/display: Check null pointers before using dc->clk_mgr Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 158/244] drm/amd/display: Check null pointer before try to access it Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 159/244] drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2) Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 161/244] drm/amd/display: fix double free issue during amdgpu module unload Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 162/244] drm/amdgpu: add list empty check to avoid null pointer issue Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 170/244] drm/amdgpu: add raven1 gfxoff quirk Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 171/244] drm/amdgpu: enable gfxoff quirk on HP 705G4 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 172/244] drm/amdkfd: Fix resource leak in criu restore queue Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 179/244] drm/amd/display: Initialize denominators' default to 1 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 180/244] drm/amd/display: Check null-initialized variables Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 181/244] drm/amd/display: Check phantom_stream before it is used Sasha Levin
2024-09-25 11:26 ` Sasha Levin [this message]
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 183/244] drm/amd/display: Deallocate DML memory if allocation fails Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 184/244] drm/amd/display: Check link_res->hpo_dp_link_enc before using it Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 185/244] drm/amd/display: Increase array size of dummy_boolean Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 186/244] drm/amd/display: Fix index out of bounds in DCN30 degamma hardware format translation Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 187/244] drm/amd/display: Fix index out of bounds in " Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 188/244] drm/amd/display: Implement bounds check for stream encoder creation in DCN401 Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 189/244] drm/amd/display: Fix index out of bounds in DCN30 color transformation Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 190/244] drm/amdgpu/gfx12: properly handle error ints on all pipes Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 191/244] drm/amdgpu/gfx9: " Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 192/244] drm/amd/display: Fix possible overflow in integer multiplication Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 193/244] drm/amd/display: Check stream_status before it is used Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 194/244] drm/amd/display: Avoid overflow assignment in link_dp_cts Sasha Levin
2024-09-25 11:26 ` [PATCH AUTOSEL 6.11 195/244] drm/amd/display: Initialize get_bytes_per_element's default to 1 Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 202/244] drm/amd/display: Force enable 3DLUT DMA check for dcn401 in DML Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 203/244] drm/amdgpu: fix unchecked return value warning for amdgpu_gfx Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 204/244] drm/amdgpu: fix unchecked return value warning for amdgpu_atombios Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 207/244] drm/radeon/r100: Handle unknown family in r100_cp_init_microcode() Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 208/244] drm/amd/display: Unlock Pipes Based On DET Allocation Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 209/244] drm/amdgpu: fix ptr check warning in gfx9 ip_dump Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 210/244] drm/amdgpu: fix ptr check warning in gfx10 ip_dump Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 211/244] drm/amdgpu: fix ptr check warning in gfx11 ip_dump Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 212/244] drm/amdgpu: Block MMR_READ IOCTL in reset Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 213/244] drm/amdgpu/gfx9: use rlc safe mode for soft recovery Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 214/244] drm/amdgpu/gfx11: enter safe mode before touching CP_INT_CNTL Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 216/244] drm/amd/pm: ensure the fw_info is not null before using it Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 217/244] drm/amdkfd: Check int source id for utcl2 poison event Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 220/244] drm/amd/display: guard write a 0 post_divider value to HW Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 223/244] drm/amdgpu/gfx12: use rlc safe mode for soft recovery Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 224/244] drm/amdgpu/gfx11: " Sasha Levin
2024-09-25 11:27 ` [PATCH AUTOSEL 6.11 225/244] drm/amdgpu/gfx10: " Sasha Levin

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=20240925113641.1297102-182-sashal@kernel.org \
    --to=sashal@kernel.org \
    --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=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dillon.varone@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gabe.teeger@amd.com \
    --cc=george.shen@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.siqueira@amd.com \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).