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

Ian Rogers posted 2 patches 2 days, 6 hours ago
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c  | 1 +
2 files changed, 3 insertions(+)
[PATCH v2 0/2] drm/amdgpu: Initialize r in VM and TTM buffer helpers
Posted by Ian Rogers 2 days, 6 hours ago
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
Re: [PATCH v2 0/2] drm/amdgpu: Initialize r in VM and TTM buffer helpers
Posted by Christian König 1 day, 2 hours ago
Reviewed-by: Christian König <christian.koenig@amd.com> for both patches.

Alex will probably pick the patches up, if not please ping me again.

Regards,
Christian.

On 11/22/26 05:53, Ian Rogers wrote:
> 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(+)
> 

Re: [PATCH v2 0/2] drm/amdgpu: Initialize r in VM and TTM buffer helpers
Posted by Alex Deucher 20 hours ago
Applied.  Thanks!

On Mon, Nov 23, 2026 at 6:56 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Reviewed-by: Christian König <christian.koenig@amd.com> for both patches.
>
> Alex will probably pick the patches up, if not please ping me again.
>
> Regards,
> Christian.
>
> On 11/22/26 05:53, Ian Rogers wrote:
> > 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(+)
> >
>