drm/i915: Prevent potential null-ptr-deref in engine_init_common
authorjsg <jsg@openbsd.org>
Tue, 13 Aug 2024 00:58:47 +0000 (00:58 +0000)
committerjsg <jsg@openbsd.org>
Tue, 13 Aug 2024 00:58:47 +0000 (00:58 +0000)
From Nirmoy Das
f1cdb599ce0ef909343d6c8e7d372defbaa382b9 in mainline linux

sys/dev/pci/drm/i915/gt/intel_engine_cs.c

index eacfe84..6b9c9c0 100644 (file)
@@ -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;