From: jsg Date: Tue, 13 Aug 2024 00:58:47 +0000 (+0000) Subject: drm/i915: Prevent potential null-ptr-deref in engine_init_common X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a9369f264c2eb7cceb27257aa244362ff89bcf80;p=openbsd drm/i915: Prevent potential null-ptr-deref in engine_init_common From Nirmoy Das f1cdb599ce0ef909343d6c8e7d372defbaa382b9 in mainline linux --- 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;