Skip to content

Commit

Permalink
drm/radeon: memory leak on bo reservation failure. v2
Browse files Browse the repository at this point in the history
On bo reservation failure, we end up leaking fpriv.

v2 (chk): rebased and added missing free on vm failure as well

Fixes: 5e386b5 ("drm/radeon: fix missing bo reservation")
Cc: stable@vger.kernel.org
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
Quentin Casasnovas authored and Christian König committed Apr 17, 2014
1 parent 681941c commit 74073c9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/radeon/radeon_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,17 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
}

r = radeon_vm_init(rdev, &fpriv->vm);
if (r)
if (r) {
kfree(fpriv);
return r;
}

r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
if (r)
if (r) {
radeon_vm_fini(rdev, &fpriv->vm);
kfree(fpriv);
return r;
}

/* map the ib pool buffer read only into
* virtual address space */
Expand Down

0 comments on commit 74073c9

Please sign in to comment.