Commit d9e9da64 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Don't deref context->file_priv ERR_PTR upon reset

When a user context is closed, it's file_priv backpointer is replaced by
ERR_PTR(-EBADF); be careful not to chase this invalid pointer after a
hang and a GPU reset.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Fixes: b083a087 ("drm/i915: Add per client max context ban limit")
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161122144121.7379-1-chris@chris-wilson.co.uk
parent 7abbd8d6
...@@ -2647,16 +2647,12 @@ static void i915_gem_context_mark_guilty(struct i915_gem_context *ctx) ...@@ -2647,16 +2647,12 @@ static void i915_gem_context_mark_guilty(struct i915_gem_context *ctx)
ctx->name, ctx->ban_score, ctx->name, ctx->ban_score,
yesno(ctx->banned)); yesno(ctx->banned));
if (!ctx->file_priv) if (!ctx->banned || IS_ERR_OR_NULL(ctx->file_priv))
return; return;
if (ctx->banned) {
ctx->file_priv->context_bans++; ctx->file_priv->context_bans++;
DRM_DEBUG_DRIVER("client %s has had %d context banned\n",
DRM_DEBUG_DRIVER("client %s has has %d context banned\n", ctx->name, ctx->file_priv->context_bans);
ctx->name,
ctx->file_priv->context_bans);
}
} }
static void i915_gem_context_mark_innocent(struct i915_gem_context *ctx) static void i915_gem_context_mark_innocent(struct i915_gem_context *ctx)
......
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