diff options
author | Imre Deak <imre.deak@intel.com> | 2014-06-06 14:04:37 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-13 15:17:39 +0200 |
commit | 9e31c2a590f27309fb8a419ba2943879af26a8cd (patch) | |
tree | 144fa00e8bca147daf4209b1bda8fa5b53897ada | |
parent | fdaf66de9e4e242bb1ce8b41db49551830336b44 (diff) | |
download | linux-9e31c2a590f27309fb8a419ba2943879af26a8cd.tar.gz linux-9e31c2a590f27309fb8a419ba2943879af26a8cd.tar.bz2 linux-9e31c2a590f27309fb8a419ba2943879af26a8cd.zip |
drm/i915: fix possible refcount leak when resetting forcewake
If the timer putting the last forcewake refcount was pending and we
canceled it, we'll leak the corresponding forcewake and RPM references.
v2:
- do the ptr casting at the caller instead of adding a separate helper
for this (Chris)
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_uncore.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index c90222dfe5ec..6a7307812881 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -321,7 +321,8 @@ static void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore) struct drm_i915_private *dev_priv = dev->dev_private; unsigned long irqflags; - del_timer_sync(&dev_priv->uncore.force_wake_timer); + if (del_timer_sync(&dev_priv->uncore.force_wake_timer)) + gen6_force_wake_timer((unsigned long)dev_priv); /* Hold uncore.lock across reset to prevent any register access * with forcewake not set correctly |