[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1398329507-5911-172-git-send-email-luis.henriques@canonical.com>
Date: Thu, 24 Apr 2014 09:51:36 +0100
From: Luis Henriques <luis.henriques@...onical.com>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
kernel-team@...ts.ubuntu.com
Cc: Christian König <christian.koenig@....com>,
Alex Deucher <alexander.deucher@....com>,
Quentin Casasnovas <quentin.casasnovas@...cle.com>,
Luis Henriques <luis.henriques@...onical.com>
Subject: [PATCH 3.11 171/182] drm/radeon: memory leak on bo reservation failure. v2
3.11.10.9 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Casasnovas <quentin.casasnovas@...cle.com>
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: Christian König <christian.koenig@....com>
Cc: Alex Deucher <alexander.deucher@....com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@...cle.com>
Signed-off-by: Christian König <christian.koenig@....com>
[ luis: backported to 3.11:
- radeon_vm_init() returns a value only after commit 6d2f294
"drm/radeon: use normal BOs for the page tables v4", which is not
in 3.11 kernel, thus dropped 1st chunk of commit ]
Signed-off-by: Luis Henriques <luis.henriques@...onical.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 42ff84b..82b8710 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -505,8 +505,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.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists