]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Call i915_globals_exit() if pci_register_device() fails
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 21 Jul 2021 15:23:54 +0000 (10:23 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 22 Jul 2021 10:05:05 +0000 (12:05 +0200)
In the unlikely event that pci_register_device() fails, we were tearing
down our PMU setup but not globals.  This leaves a bunch of memory slabs
lying around.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: 32eb6bcfdda9 ("drm/i915: Make request allocation caches global")
[danvet: Fix conflicts against removal of the globals_flush
infrastructure.]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210721152358.2893314-3-jason@jlekstrand.net
drivers/gpu/drm/i915/i915_globals.c
drivers/gpu/drm/i915/i915_pci.c

index 7fe2e503897bbf92afd673fd6ab7ac9694071bb0..0a1b8920a3ba9b277db51b76e299cb80443b6d0e 100644 (file)
@@ -59,7 +59,7 @@ int __init i915_globals_init(void)
        return 0;
 }
 
-void __exit i915_globals_exit(void)
+void i915_globals_exit(void)
 {
        __i915_globals_cleanup();
 }
index 2cdace47610b6b22f8dd119ab7197bcc91cb395c..ef1ddb1ebaf1de3851ba76f4f51292d0a99a9e0a 100644 (file)
@@ -1195,6 +1195,7 @@ static int __init i915_init(void)
        err = pci_register_driver(&i915_pci_driver);
        if (err) {
                i915_pmu_exit();
+               i915_globals_exit();
                return err;
        }