diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-11-23 05:52:21 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-26 15:47:34 -0500 |
commit | 51f1f6f51712aade68cabb145ed8bab4a6c3997e (patch) | |
tree | e89e3aebb53d7a56e96278bb3c7dc4d43c612dee | |
parent | 8ca606de76a212b8c2b8212f82a13f8201cc3117 (diff) |
drm/amdgpu: Fix static checker warning
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c:49 amdgpu_allocate_static_csa()
error: uninitialized symbol 'ptr'.
the test if (!bo) doesn't work, as the bo is a pointer to a pointer.
if bo create failed, the *bo will be set to NULL.
so change to test *bo.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c index 0c590ddf250a..5b550706ee76 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | |||
@@ -43,7 +43,7 @@ int amdgpu_allocate_static_csa(struct amdgpu_device *adev, struct amdgpu_bo **bo | |||
43 | r = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE, | 43 | r = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE, |
44 | domain, bo, | 44 | domain, bo, |
45 | NULL, &ptr); | 45 | NULL, &ptr); |
46 | if (!bo) | 46 | if (!*bo) |
47 | return -ENOMEM; | 47 | return -ENOMEM; |
48 | 48 | ||
49 | memset(ptr, 0, size); | 49 | memset(ptr, 0, size); |