Skip to content

Commit

Permalink
drm/radeon: fix missing bo reservation
Browse files Browse the repository at this point in the history
Otherwise we might get a crash here.

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Feb 27, 2014
1 parent 9f050c7 commit 5e386b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/radeon/radeon_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,19 @@ 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)
return r;

/* map the ib pool buffer read only into
* virtual address space */
bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,
rdev->ring_tmp_bo.bo);
r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET,
RADEON_VM_PAGE_READABLE |
RADEON_VM_PAGE_SNOOPED);

radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
if (r) {
radeon_vm_fini(rdev, &fpriv->vm);
kfree(fpriv);
Expand Down

0 comments on commit 5e386b5

Please sign in to comment.