Skip to content

Commit

Permalink
drm/i915: Drop rpm wakeref on error in debugfs/i915_drop_caches_set
Browse files Browse the repository at this point in the history
Use single exit point to drop rpm wakeref in case of an error.

Fixes: 9d3eb2c ("drm/i915: Hold rpm wakeref for debugfs/i915_drop_caches_set")
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20181018092025.24076-1-joonas.lahtinen@linux.intel.com
  • Loading branch information
Joonas Lahtinen committed Oct 18, 2018
1 parent e346a99 commit 198a2a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4197,7 +4197,7 @@ i915_drop_caches_set(void *data, u64 val)
if (val & (DROP_ACTIVE | DROP_RETIRE | DROP_RESET_SEQNO)) {
ret = mutex_lock_interruptible(&i915->drm.struct_mutex);
if (ret)
return ret;
goto out;

if (val & DROP_ACTIVE)
ret = i915_gem_wait_for_idle(i915,
Expand Down Expand Up @@ -4244,6 +4244,7 @@ i915_drop_caches_set(void *data, u64 val)
if (val & DROP_FREED)
i915_gem_drain_freed_objects(i915);

out:
intel_runtime_pm_put(i915);

return ret;
Expand Down

0 comments on commit 198a2a2

Please sign in to comment.