[3.11.y.z extended stable] Patch "drm/radeon: memory leak on bo reservation failure. v2" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Tue Apr 22 10:06:21 UTC 2014


This is a note to let you know that I have just added a patch titled

    drm/radeon: memory leak on bo reservation failure. v2

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 6b7f352d20955978ddb57159552e7a3b0f77f8c2 Mon Sep 17 00:00:00 2001
From: Quentin Casasnovas <quentin.casasnovas at oracle.com>
Date: Tue, 18 Mar 2014 17:16:52 +0100
Subject: drm/radeon: memory leak on bo reservation failure. v2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas at oracle.com>
Signed-off-by: Christian König <christian.koenig at amd.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 at canonical.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





More information about the kernel-team mailing list