drm/i915/gt: Cleanup partial engine discovery failures
authorjsg <jsg@openbsd.org>
Thu, 19 Jan 2023 00:17:47 +0000 (00:17 +0000)
committerjsg <jsg@openbsd.org>
Thu, 19 Jan 2023 00:17:47 +0000 (00:17 +0000)
From Chris Wilson
5c855bcc730656c4b7d30aaddcd0eafc7003e112 in linux-6.1.y/6.1.7
78a033433a5ae4fee85511ee075bc9a48312c79e in mainline linux

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

index 8432539..1323eec 100644 (file)
@@ -1347,8 +1347,13 @@ int intel_engines_init(struct intel_gt *gt)
                        return err;
 
                err = setup(engine);
-               if (err)
+               if (err) {
+                       intel_engine_cleanup_common(engine);
                        return err;
+               }
+
+               /* The backend should now be responsible for cleanup */
+               GEM_BUG_ON(engine->release == NULL);
 
                err = engine_init_common(engine);
                if (err)