drm/radeon: memory leak on bo reservation failure. v2
Subsystems (2)
PATCH 1/1 drm/radeon: memory leak on bo reservation failure. v2
From: Quentin Casasnovas <[email protected]>
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 <[email protected]>
Cc Alex Deucher <[email protected]>
Signed-off-by Quentin Casasnovas <[email protected]>
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/radeon/radeon_kms.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_kms.c +7 -2
@@ -574,12 +574,17 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) } r =radeon_vm_init (rdev, &fpriv->vm); -if (r) +if (r) { +kfree (fpriv);return r; + } 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 */
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Christian König
From: Quentin Casasnovas <[email protected]>
On bo reservation failure, we end up leaking fpriv.
Quoted 8 lines
v2 (chk): rebased and added missing free on vm failure as well
Fixes 5e386b574cf7e1 ("drm/radeon: fix missing bo reservation")Cc Christian König <[email protected]>Cc Alex Deucher <[email protected]>Signed-off-by Quentin Casasnovas <[email protected]>Signed-off-by Christian König <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 31 lines
--- drivers/gpu/drm/radeon/radeon_kms.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)drivers/gpu/drm/radeon/radeon_kms.c +7
-3@@ -574,12 +574,17 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) } r =radeon_vm_init (rdev, &fpriv->vm); -if (r) +if (r) { +kfree (fpriv);return r; + } 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
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel