drm/radeon: memory leak on bo reservation failure. v2
On bo reservation failure, we end up leaking fpriv.
v2 (chk): rebased and added missing free on vm failure as well
Fixes: 5e386b574c
("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>
Signed-off-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
681941c179
commit
74073c9dd2
1 changed files with 7 additions and 2 deletions
|
@ -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);
|
r = radeon_vm_init(rdev, &fpriv->vm);
|
||||||
if (r)
|
if (r) {
|
||||||
|
kfree(fpriv);
|
||||||
return r;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
|
r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
|
||||||
if (r)
|
if (r) {
|
||||||
|
radeon_vm_fini(rdev, &fpriv->vm);
|
||||||
|
kfree(fpriv);
|
||||||
return r;
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
/* map the ib pool buffer read only into
|
/* map the ib pool buffer read only into
|
||||||
* virtual address space */
|
* virtual address space */
|
||||||
|
|
Loading…
Add table
Reference in a new issue