aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudip Mukherjee <[email protected]>2015-10-08 19:28:01 +0530
committerAlex Deucher <[email protected]>2015-10-08 12:18:23 -0400
commit7a574557e62dc3d2d7ed55fa0b99e7d5bb403878 (patch)
tree687c340beefa359ee7b693d73abd2f53bb979163
parent028423b0d8fa27c30a46da4af2a5cab230369de6 (diff)
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" <[email protected]> Cc: Jammy Zhou <[email protected]> Cc: Chunming Zhou <[email protected]> Cc: Alex Deucher <[email protected]> Cc: "monk.liu" <[email protected]> Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
-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 */