答复: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va
diff mbox

Message ID DM5PR12MB1610C9FFFB485DBFB977C725844E0@DM5PR12MB1610.namprd12.prod.outlook.com
State New
Headers show

Commit Message

Liu, Monk Feb. 4, 2017, 7:07 a.m. UTC
thanks for this catch!


Reviewed-by: Monk Liu <monk.liu@amd.com>


________________________________
发件人: Colin King <colin.king@canonical.com>
发送时间: 2017年2月4日 4:23:42
收件人: Deucher, Alexander; Koenig, Christian; David Airlie; Liu, Monk; Yu, Xiangliang; amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org
抄送: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
主题: [PATCH] drm/amdgpu/virt: fix double kfree on bo_va

From: Colin Ian King <colin.king@canonical.com>


bo_va is being kfree'd twice, once in the call to amdgpu_vm_bo_rmv
and then a short while later. Fix this double free by removing
the 2nd kfree.

Detected by CoverityScan, CID#1399524 ("Double Free")

Signed-off-by: Colin Ian King <colin.king@canonical.com>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 -
 1 file changed, 1 deletion(-)

--
2.10.2

Patch
diff mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 3fd951c..dcfb7df 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -83,7 +83,6 @@  int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm)
                 DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);
                 amdgpu_vm_bo_rmv(adev, bo_va);
                 ttm_eu_backoff_reservation(&ticket, &list);
-               kfree(bo_va);
                 return r;
         }