drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 30 Sep 2017 08:14:13 +0000 (11:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2017 10:26:34 +0000 (11:26 +0100)
commit 78aa02c713fcf19e9bc8511ab61a5fd6c877cc01 upstream.

After commit ea09729c9302 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index bd20ff018512271b79d9dac6c40b21693ea54f6b..4fb5e14d4879c960873a02ac15c20b8d5c62a39c 100644 (file)
@@ -1201,7 +1201,7 @@ static void amdgpu_vm_invalidate_level(struct amdgpu_vm_pt *parent)
 int amdgpu_vm_update_directories(struct amdgpu_device *adev,
                                 struct amdgpu_vm *vm)
 {
-       int r;
+       int r = 0;
 
        r = amdgpu_vm_update_level(adev, vm, &vm->root, 0);
        if (r)