aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQuentin Casasnovas <quentin.casasnovas@oracle.com>2014-03-18 17:16:52 +0100
committerJiri Slaby <jslaby@suse.cz>2014-07-02 12:05:56 +0200
commitd5e54437bcb1d82210b7fd810d933c27d1d1fe4e (patch)
treeccfc6fbc8fa3dff3471c357937009e5c9562638f /drivers
parentc0994abad32816af80e7a32b37e1f2868d77a584 (diff)
drm/radeon: memory leak on bo reservation failure. v2
commit 74073c9dd29905645feb6dee03c144657a9844cd upstream. On bo reservation failure, we end up leaking fpriv. v2 (chk): rebased and added missing free on vm failure as well Fixes: 5e386b574cf7e1 ("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> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Conflicts: drivers/gpu/drm/radeon/radeon_kms.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 7456ce186f2..a134e8bf53f 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -501,8 +501,11 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
radeon_vm_init(rdev, &fpriv->vm);
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 */