From: François Tigeot Date: Fri, 11 Dec 2015 19:06:38 +0000 (+0100) Subject: drm/i915: Remove duplicated code in i915_gem_fault (1/3) X-Git-Tag: v4.6.0rc~1203 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/ef1906ea52ac216f08a96f0ddd6cb2c015977a99 drm/i915: Remove duplicated code in i915_gem_fault (1/3) --- diff --git a/sys/dev/drm/i915/i915_gem.c b/sys/dev/drm/i915/i915_gem.c index 0891c0fd09..30a423afcf 100644 --- a/sys/dev/drm/i915/i915_gem.c +++ b/sys/dev/drm/i915/i915_gem.c @@ -1714,11 +1714,8 @@ have_page: i915_gem_object_ggtt_unpin(obj); mutex_unlock(&dev->struct_mutex); - if (oldm != NULL) - vm_page_free(oldm); - if (didpip) - vm_object_pip_wakeup(vm_obj); - return (VM_PAGER_OK); + ret = VM_PAGER_OK; + goto done; /* * ALTERNATIVE ERROR RETURN. @@ -1763,18 +1760,13 @@ out: break; } - intel_runtime_pm_put(dev_priv); - - /* - * Error return. We already NULL'd out *mres so we should be able - * to free (oldm) here even though we are returning an error and the - * caller usually handles the freeing. - */ +done: if (oldm != NULL) vm_page_free(oldm); if (didpip) vm_object_pip_wakeup(vm_obj); + intel_runtime_pm_put(dev_priv); return ret; }