drm/amdgpu: Fix static checker warning
Subsystems (2)
PATCH 1/1 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. so need to check !*bo
--- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1 -1
@@ -52,7 +52,7 @@ int amdgpu_allocate_static_csa(struct amdgpu_device *adev, struct amdgpu_bo **bo r =amdgpu_bo_create_kernel (adev, size,PAGE_SIZE , domain, bo,NULL , &ptr); -if (!bo) +if (!*bo)return -ENOMEM ;memset (ptr,0 , size);
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1542969136-20300-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Christian König
Reviewed-byAm 23.11.18 um 11:32 schrieb Rex Zhu:
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c:49amdgpu_allocate_static_csa()
error: uninitialized symbol 'ptr'.the test if (!bo) doesn't work, as the bo is a pointer to a pointer. so need to check !*bo
Signed-off-by Rex Zhu <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c int amdgpu_allocate_static_csa(struct amdgpu_device *adev, struct amdgpu_bo **bo · line 58
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c +1
-1@@ -52,7 +52,7 @@ int amdgpu_allocate_static_csa(struct amdgpu_device *adev, struct amdgpu_bo **bo r =amdgpu_bo_create_kernel (adev, size,PAGE_SIZE , domain, bo,NULL , &ptr); -if (!bo) +if (!*bo)return -ENOMEM ;memset (ptr,0 , size);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx