mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
drm/i915: Prevent potential null-ptr-deref in engine_init_common
If measure_breadcrumb_dw() returns an error and bce isn't created,
this commit ensures that intel_engine_destroy_pinned_context()
is not called with a NULL bce.
v2: Fix the subject s/UAF/null-ptr-deref(Jani)
Fixes: b352749936 ("drm/i915: Create a kernel context for GGTT updates")
Cc: Oak Zeng <oak.zeng@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231011122547.7085-1-nirmoy.das@intel.com
This commit is contained in:
parent
2d6e2b10a7
commit
f1cdb599ce
|
|
@ -1491,7 +1491,8 @@ static int engine_init_common(struct intel_engine_cs *engine)
|
|||
return 0;
|
||||
|
||||
err_bce_context:
|
||||
intel_engine_destroy_pinned_context(bce);
|
||||
if (bce)
|
||||
intel_engine_destroy_pinned_context(bce);
|
||||
err_ce_context:
|
||||
intel_engine_destroy_pinned_context(ce);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user