Commit 22f880ca authored by Matthew Auld's avatar Matthew Auld Committed by Mika Kuoppala

drm/i915/perf: destroy stream on sample_flags mismatch

If we were to ever encounter a sample_flags mismatch we need to ensure
we destroy the stream when we bail.

Fixes: d7965152 ("drm/i915: Enable i915 perf stream for Haswell OA unit")
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Robert Bragg <robert@sixbynine.org>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170327203459.18398-1-matthew.auld@intel.com
parent 14292b7f
...@@ -1705,7 +1705,7 @@ i915_perf_open_ioctl_locked(struct drm_i915_private *dev_priv, ...@@ -1705,7 +1705,7 @@ i915_perf_open_ioctl_locked(struct drm_i915_private *dev_priv,
*/ */
if (WARN_ON(stream->sample_flags != props->sample_flags)) { if (WARN_ON(stream->sample_flags != props->sample_flags)) {
ret = -ENODEV; ret = -ENODEV;
goto err_alloc; goto err_flags;
} }
list_add(&stream->link, &dev_priv->perf.streams); list_add(&stream->link, &dev_priv->perf.streams);
...@@ -1728,6 +1728,7 @@ i915_perf_open_ioctl_locked(struct drm_i915_private *dev_priv, ...@@ -1728,6 +1728,7 @@ i915_perf_open_ioctl_locked(struct drm_i915_private *dev_priv,
err_open: err_open:
list_del(&stream->link); list_del(&stream->link);
err_flags:
if (stream->ops->destroy) if (stream->ops->destroy)
stream->ops->destroy(stream); stream->ops->destroy(stream);
err_alloc: err_alloc:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment