Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [PATCH v2 0/2] drm/amdgpu: Initialize r in VM and TTM buffer helpers
@ 2026-11-22  4:53 Ian Rogers
  2026-11-22  4:53 ` [PATCH v2 1/2] drm/amdgpu: initialize r in amdgpu_vm_bo_update() Ian Rogers
  2026-11-22  4:53 ` [PATCH v2 2/2] drm/amdgpu: initialize r in amdgpu_ttm_clear_buffer() Ian Rogers
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Rogers @ 2026-11-22  4:53 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Simona Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, llvm, Elkin Cruz, Ian Rogers

Two fixes in drm/amdgpu for uninitialized return-value regressions
found via Clang -Wconditional-uninitialized on an x86_64
allyesconfig build:

1. Set r = 0 in the 'else if (!bo)' branch of amdgpu_vm_bo_update().
2. Set r = 0 right after the while loop before 'error:' in
   amdgpu_ttm_clear_buffer().

Build-tested with LLVM=1 W=1 (-Werror) and -Wconditional-uninitialized;
not runtime-tested on AMDGPU hardware.

v2:
  - Keep 'int r;' uninitialized at declaration in both functions so
    future missing-assignment paths are not masked; instead set 'r = 0;'
    inside 'else if (!bo)' in patch 1/2 and directly before 'error:' in
    patch 2/2 (Christian König).

v1: https://lore.kernel.org/r/cover.1795106955.git.irogers@google.com

Ian Rogers (2):
  drm/amdgpu: initialize r in amdgpu_vm_bo_update()
  drm/amdgpu: initialize r in amdgpu_ttm_clear_buffer()

 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 1 +
 2 files changed, 3 insertions(+)

-- 
2.56.1.750.gf70dc682cf-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-22  4:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22  4:53 [PATCH v2 0/2] drm/amdgpu: Initialize r in VM and TTM buffer helpers Ian Rogers
2026-11-22  4:53 ` [PATCH v2 1/2] drm/amdgpu: initialize r in amdgpu_vm_bo_update() Ian Rogers
2026-11-22  4:53 ` [PATCH v2 2/2] drm/amdgpu: initialize r in amdgpu_ttm_clear_buffer() Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox