lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drm/radeon: memory leak on bo reservation failure.
Am 14.04.2014 23:43, schrieb Deucher, Alexander:
>> -----Original Message-----
>> From: Quentin Casasnovas [mailto:quentin.casasnovas@oracle.com]
>> Sent: Tuesday, March 18, 2014 12:17 PM
>> To: David Airlie
>> Cc: linux-kernel@vger.kernel.org; Quentin Casasnovas;
>> stable@vger.kernel.org; Koenig, Christian; Deucher, Alexander
>> Subject: [PATCH] drm/radeon: memory leak on bo reservation failure.
>>
>> 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>
> Sorry I missed this. It looks like we probably want an updated version for newer kernels where radeon_vm_init() can fail as well.

I've rebased the stuff and added the missing free on vm failure as well.

Patch is on the list and in my 3.15 queue.

Christian.

>
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
> Alex
>
>> ---
>> 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
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-04-15 12:01    [W:0.049 / U:22.524 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site