Skip to content

Commit

Permalink
drm/i915: avoid uninitialised var in eb_parse()
Browse files Browse the repository at this point in the history
The backport of c9d9fdb to 5.10 in
6976f3c removed more than it should
have leading to 'batch' being used uninitialised.  The 5.13 backport and
the mainline commit did not remove the portion this patch adds back.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Fixes: 6976f3c ("drm/i915: Revert "drm/i915/gem: Asynchronous cmdparser"")
Cc: <stable@vger.kernel.org> # 5.10
Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jonathangray authored and gregkh committed Aug 12, 2021
1 parent a3e6bd0 commit 11891ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
Expand Up @@ -2351,6 +2351,12 @@ static int eb_parse(struct i915_execbuffer *eb)
eb->batch_flags |= I915_DISPATCH_SECURE;
}

batch = eb_dispatch_secure(eb, shadow);
if (IS_ERR(batch)) {
err = PTR_ERR(batch);
goto err_trampoline;
}

err = intel_engine_cmd_parser(eb->engine,
eb->batch->vma,
eb->batch_start_offset,
Expand All @@ -2377,6 +2383,7 @@ static int eb_parse(struct i915_execbuffer *eb)
err_unpin_batch:
if (batch)
i915_vma_unpin(batch);
err_trampoline:
if (trampoline)
i915_vma_unpin(trampoline);
err_shadow:
Expand Down

0 comments on commit 11891ad

Please sign in to comment.