All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Hawking Zhang" <Hawking.Zhang@amd.com>,
	"Likun Gao" <Likun.Gao@amd.com>, "Frank Min" <Frank.Min@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	llvm@lists.linux.dev
Subject: [PATCH] drm/amdgpu: avoid uninitialized pointer use
Date: Tue,  1 Dec 2026 10:15:31 +0100	[thread overview]
Message-ID: <20261201091609.898205-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

clang warns about passing an uninitialized pointer into another
function, even when that function does not access the pointer:

drivers/gpu/drm/amd/amdgpu/imu_v13_0.c:264:30: error: variable 'data' is uninitialized when used here [-Werror,-Wuninitialized]
  264 |                         program_imu_rlc_ram(adev, data, (const u32)size);
      |                                                   ^~~~

Presumably there are plans to add an actual register array later that would
make this similar to other versions of the imu code.  In the meantime,
remove the unused/uninitialized pointer and just pass a hardcoded NULL/0
argument to program_imu_rlc_ram.

Fixes: 9caddf5f7de7 ("drm/amdgpu: Add imu v13 ip block v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/amdgpu/imu_v13_0.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c b/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c
index aea418be444a..660bd587c7d7 100644
--- a/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/imu_v13_0.c
@@ -252,8 +252,7 @@ static void program_imu_rlc_ram(struct amdgpu_device *adev,
 
 static void imu_v13_0_program_rlc_ram(struct amdgpu_device *adev)
 {
-	u32 reg_data, size = 0;
-	const u32 *data;
+	u32 reg_data;
 	int r = -EINVAL;
 
 	WREG32_SOC15(GC, 0, regGFX_IMU_RLC_RAM_INDEX, 0x2);
@@ -261,7 +260,7 @@ static void imu_v13_0_program_rlc_ram(struct amdgpu_device *adev)
 	switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
 	case IP_VERSION(13, 0, 1):
 		if (!r)
-			program_imu_rlc_ram(adev, data, (const u32)size);
+			program_imu_rlc_ram(adev, NULL, 0);
 		break;
 	default:
 		BUG();
-- 
2.53.0


             reply	other threads:[~2026-12-01  9:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  9:15 Arnd Bergmann [this message]
2026-12-01 14:39 ` [PATCH] drm/amdgpu: avoid uninitialized pointer use Alex Deucher

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=20261201091609.898205-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=Frank.Min@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Likun.Gao@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arnd@arndb.de \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=justinstitt@google.com \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=simona@ffwll.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.