Skip to content

Commit

Permalink
drm/i915: Call i915_globals_exit() if pci_register_device() fails
Browse files Browse the repository at this point in the history
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: 32eb6bc ("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
  • Loading branch information
gfxstrand authored and danvet committed Jul 22, 2021
1 parent 75d3bf8 commit db48488
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/i915_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit db48488

Please sign in to comment.