public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: memory leak on bo reservation failure.
@ 2014-03-18 16:16 Quentin Casasnovas
  2014-04-08  7:36 ` Quentin Casasnovas
  2014-04-14 21:43 ` Deucher, Alexander
  0 siblings, 2 replies; 4+ messages in thread
From: Quentin Casasnovas @ 2014-03-18 16:16 UTC (permalink / raw)
  To: David Airlie
  Cc: linux-kernel, Quentin Casasnovas, stable, Christian König,
	Alex Deucher

On bo reservation failure, we end up leaking fpriv.

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>
---
 drivers/gpu/drm/radeon/radeon_kms.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 66ed3ea..51cda80 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -546,8 +546,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 */
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-15  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 16:16 [PATCH] drm/radeon: memory leak on bo reservation failure Quentin Casasnovas
2014-04-08  7:36 ` Quentin Casasnovas
2014-04-14 21:43 ` Deucher, Alexander
2014-04-15  9:33   ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox