Skip to content

Commit

Permalink
drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_dire…
Browse files Browse the repository at this point in the history
…ctories()

After commit ea09729 ("drm/amdgpu: rework page directory filling
v2") then it becomes a lot harder to verify that "r" is initialized.  My
static checker complains and so I've reviewed the code.  It does look
like it might be buggy... Anyway, it doesn't hurt to set "r" to zero
at the start.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Dan Carpenter authored and Alex Deucher committed Nov 8, 2017
1 parent 40a9960 commit 78aa02c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ static void amdgpu_vm_invalidate_level(struct amdgpu_vm *vm,
int amdgpu_vm_update_directories(struct amdgpu_device *adev,
struct amdgpu_vm *vm)
{
int r;
int r = 0;

spin_lock(&vm->status_lock);
while (!list_empty(&vm->relocated)) {
Expand Down

0 comments on commit 78aa02c

Please sign in to comment.