aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-10-08 19:28:01 +0530
committerAlex Deucher <alexander.deucher@amd.com>2015-10-08 12:18:23 -0400
commit7a574557e62dc3d2d7ed55fa0b99e7d5bb403878 (patch)
tree687c340beefa359ee7b693d73abd2f53bb979163 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parentdrm/amdgpu: fix 32-bit compiler warning (diff)
downloadlinux-dev-7a574557e62dc3d2d7ed55fa0b99e7d5bb403878.tar.xz
linux-dev-7a574557e62dc3d2d7ed55fa0b99e7d5bb403878.zip
drm/amdgpu: fix memory leak in amdgpu_vm_update_page_directory
If amdgpu_ib_get() fails we returned the error code but we missed freeing ib. Cc: "Christian König" <christian.koenig@amd.com> Cc: Jammy Zhou <Jammy.Zhou@amd.com> Cc: Chunming Zhou <david1.zhou@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "monk.liu" <monk.liu@amd.com> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 1e14531353e0..53d551f2d839 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -455,8 +455,10 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device *adev,
return -ENOMEM;
r = amdgpu_ib_get(ring, NULL, ndw * 4, ib);
- if (r)
+ if (r) {
+ kfree(ib);
return r;
+ }
ib->length_dw = 0;
/* walk over the address space and update the page directory */