]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix bug in user proto-context creation that leaked contexts
authorMatthew Brost <matthew.brost@intel.com>
Fri, 1 Oct 2021 15:58:25 +0000 (08:58 -0700)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 5 Oct 2021 09:19:39 +0000 (10:19 +0100)
commit4ecc564548a8579652f5f7db22616ef8bc6164ae
tree8634060d805ab1ced277e9f8c920065b0004b56e
parent4e5cc1d57f45c35cfb527c76a8f09567060c08b4
drm/i915: Fix bug in user proto-context creation that leaked contexts

Set number of engines before attempting to create contexts so the
function free_engines can clean up properly. Also check return of
alloc_engines for NULL.

v2:
 (Tvrtko)
  - Send as stand alone patch
 (John Harrison)
  - Check for alloc_engines returning NULL
v3:
 (Checkpatch / Tvrtko)
  - Remove braces around single line if statement

Cc: Jason Ekstrand <jason@jlekstrand.net>
Fixes: c69ae6cfbc57 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211001155825.6762-1-matthew.brost@intel.com
drivers/gpu/drm/i915/gem/i915_gem_context.c