Skip to content

drm/amdgpu: Initialize r in VM and TTM buffer helpers

Ian Rogers amd-gfx dri-devel lkml llvm 2 versions – Applied

Status from this message: Applied. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesApplied
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- 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).

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2drm/amdgpu: initialize r in amdgpu_vm_bo_update()drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+1 -00 replies
2/2drm/amdgpu: initialize r in amdgpu_ttm_clear_buffer()drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+2 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChristian König
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] drm/amdgpu: Initialize r in VM and TTM buffer helpers

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/[email protected]

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(+)
Signature · 1 line
2.56.1.750.gf70dc682cf-goog