From a9369f264c2eb7cceb27257aa244362ff89bcf80 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 13 Aug 2024 00:58:47 +0000 Subject: [PATCH] drm/i915: Prevent potential null-ptr-deref in engine_init_common From Nirmoy Das f1cdb599ce0ef909343d6c8e7d372defbaa382b9 in mainline linux --- sys/dev/pci/drm/i915/gt/intel_engine_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/i915/gt/intel_engine_cs.c b/sys/dev/pci/drm/i915/gt/intel_engine_cs.c index eacfe846112..6b9c9c0bfa5 100644 --- a/sys/dev/pci/drm/i915/gt/intel_engine_cs.c +++ b/sys/dev/pci/drm/i915/gt/intel_engine_cs.c @@ -1523,7 +1523,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; -- 2.20.1