amdgpu: fix unitialized variable
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 20 May 2020 13:32:05 +0000 (15:32 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 22 May 2020 07:12:14 +0000 (09:12 +0200)
clang warning:
    variable 'va_handle' is used uninitialized whenever 'if' condition is false

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5119>

src/gallium/winsys/amdgpu/drm/amdgpu_bo.c

index 0aef34acd2d065cf8e645b2582a24e911c08d36b..e359f1aa41d807e75c67c79b18545c526ef89b37 100644 (file)
@@ -477,7 +477,7 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *ws,
    amdgpu_bo_handle buf_handle;
    uint64_t va = 0;
    struct amdgpu_winsys_bo *bo;
-   amdgpu_va_handle va_handle;
+   amdgpu_va_handle va_handle = NULL;
    int r;
 
    /* VRAM or GTT must be specified, but not both at the same time. */