[PATCH -next] drm/amdgpu: Fix return value check in amdgpu_allocate_static_csa()
Zhu, Rex
Rex.Zhu at amd.com
Tue Dec 4 07:39:56 UTC 2018
Hi Yongjun,
This issue has been fixed.
Thanks.
Best Regards
Rex
commit 51f1f6f51712aade68cabb145ed8bab4a6c3997e
Author: Rex Zhu <Rex.Zhu at amd.com>
Date: Fri Nov 23 18:52:21 2018 +0800
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 at amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: Wei Yongjun <weiyongjun1 at huawei.com>
Sent: Tuesday, December 4, 2018 2:39 PM
To: Deucher, Alexander; Koenig, Christian; Zhou, David(ChunMing); airlied at linux.ie; Zhu, Rex; Liu, Monk
Cc: Wei Yongjun; amd-gfx at lists.freedesktop.org; dri-devel at lists.freedesktop.org; linux-kernel at vger.kernel.org; kernel-janitors at vger.kernel.org
Subject: [PATCH -next] drm/amdgpu: Fix return value check in amdgpu_allocate_static_csa()
Fix the return value check which testing the wrong variable
in amdgpu_allocate_static_csa().
Fixes: 7946340fa389 ("drm/amdgpu: Move csa related code to separate file")
Signed-off-by: Wei Yongjun <weiyongjun1 at huawei.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
index 0c590dd..a5fbc6f 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
r = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE,
domain, bo,
NULL, &ptr);
- if (!bo)
+ if (!r)
return -ENOMEM;
memset(ptr, 0, size);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20181204/66c5daf0/attachment.html>
More information about the amd-gfx
mailing list