Re: [PATCH -next] drm/amdgpu: Fix return value check in amdgpu_allocate_static_csa()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yongjun,


This issue has been fixed.


Thanks.


Best Regards

Rex




commit 51f1f6f51712aade68cabb145ed8bab4a6c3997e
Author: Rex Zhu <Rex.Zhu@xxxxxxx>
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@xxxxxxx>
    Signed-off-by: Rex Zhu <Rex.Zhu@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>





From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Sent: Tuesday, December 4, 2018 2:39 PM
To: Deucher, Alexander; Koenig, Christian; Zhou, David(ChunMing); airlied@xxxxxxxx; Zhu, Rex; Liu, Monk
Cc: Wei Yongjun; amd-gfx@xxxxxxxxxxxxxxxxxxxxx; dri-devel@xxxxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx
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@xxxxxxxxxx>
---
 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);



_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux