summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/i915_drv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 88d87ee7bf6..639545cb51d 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -1397,12 +1397,10 @@ i915_gem_gtt_map_ioctl(struct drm_device *dev, void *data,
UVM_INH_SHARE, UVM_ADV_RANDOM, 0), curproc);
done:
- if (ret != 0)
- drm_unref(&obj->uobj);
- DRM_UNLOCK();
-
if (ret == 0)
args->addr_ptr = (uint64_t) addr + (args->offset & PAGE_MASK);
+ else
+ drm_unref(&obj->uobj);
return (ret);
}