AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eslam Khafagy <eslam.medhat1993@gmail.com>
To: "Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Alex Hung" <alex.hung@amd.com>, "Wayne Lin" <Wayne.Lin@amd.com>,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Tom Chung" <chiahsuan.chung@amd.com>,
	"Dominik Kaszewski" <dominik.kaszewski@amd.com>,
	"Yilin Chen" <Yilin.Chen@amd.com>,
	amd-gfx@lists.freedesktop.org (open list:AMD DISPLAY CORE),
	dri-devel@lists.freedesktop.org (open list:DRM DRIVERS),
	linux-kernel@vger.kernel.org (open list)
Cc: eslam.medhat1993@gmail.com
Subject: [PATCH RESEND] drm/amd/display: Initialize return value in dm_cache_state()
Date: Wed,  8 Oct 2025 01:45:44 +0300	[thread overview]
Message-ID: <20251007224549.87548-1-eslam.medhat1993@gmail.com> (raw)

Initialize the return variable "r" to 0 in dm_cache_state() to fix
a potential use of uninitialized variable warning.

The return value for this function might not be a PTR_ERR, in casse if
condition fails. In that case we ensure predictable reutrn.

Signed-off-by: Eslam Khafagy <eslam.medhat1993@gmail.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 8e1622bf7a42..6b4f3eb9ce48 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3115,7 +3115,7 @@ static void hpd_rx_irq_work_suspend(struct amdgpu_display_manager *dm)
 
 static int dm_cache_state(struct amdgpu_device *adev)
 {
-	int r;
+	int r = 0;
 
 	adev->dm.cached_state = drm_atomic_helper_suspend(adev_to_drm(adev));
 	if (IS_ERR(adev->dm.cached_state)) {
-- 
2.43.0


             reply	other threads:[~2025-10-08 12:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 22:45 Eslam Khafagy [this message]
2025-10-08  2:15 ` [PATCH RESEND] drm/amd/display: Initialize return value in dm_cache_state() Mario Limonciello
2025-10-08 22:00   ` Eslam Khafagy

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=20251007224549.87548-1-eslam.medhat1993@gmail.com \
    --to=eslam.medhat1993@gmail.com \
    --cc=Wayne.Lin@amd.com \
    --cc=Yilin.Chen@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dominik.kaszewski@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@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