diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 3cf9c1fa6475..686411e4e4f6 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -605,14 +605,14 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
605 | return -ENOMEM; | 605 | return -ENOMEM; |
606 | } | 606 | } |
607 | 607 | ||
608 | vm = &fpriv->vm; | ||
609 | r = radeon_vm_init(rdev, vm); | ||
610 | if (r) { | ||
611 | kfree(fpriv); | ||
612 | return r; | ||
613 | } | ||
614 | |||
615 | if (rdev->accel_working) { | 608 | if (rdev->accel_working) { |
609 | vm = &fpriv->vm; | ||
610 | r = radeon_vm_init(rdev, vm); | ||
611 | if (r) { | ||
612 | kfree(fpriv); | ||
613 | return r; | ||
614 | } | ||
615 | |||
616 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); | 616 | r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); |
617 | if (r) { | 617 | if (r) { |
618 | radeon_vm_fini(rdev, vm); | 618 | radeon_vm_fini(rdev, vm); |
@@ -668,9 +668,9 @@ void radeon_driver_postclose_kms(struct drm_device *dev, | |||
668 | radeon_vm_bo_rmv(rdev, vm->ib_bo_va); | 668 | radeon_vm_bo_rmv(rdev, vm->ib_bo_va); |
669 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); | 669 | radeon_bo_unreserve(rdev->ring_tmp_bo.bo); |
670 | } | 670 | } |
671 | radeon_vm_fini(rdev, vm); | ||
671 | } | 672 | } |
672 | 673 | ||
673 | radeon_vm_fini(rdev, vm); | ||
674 | kfree(fpriv); | 674 | kfree(fpriv); |
675 | file_priv->driver_priv = NULL; | 675 | file_priv->driver_priv = NULL; |
676 | } | 676 | } |