Skip to content

Commit

Permalink
drm/ast: Fix incorrect free on ioregs
Browse files Browse the repository at this point in the history
If the platform has no IO space, ioregs is placed next to the already
allocated regs. In this case, it should not be separately freed.

This prevents a kernel warning from __vunmap "Trying to vfree()
nonexistent vm area" when unloading the driver.

Fixes: 0dd6830 ("drm/ast: Try to use MMIO registers when PIO isn't supported")

Signed-off-by: Sam Bobroff <[email protected]>
Cc: <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
Sam Bobroff authored and airlied committed Nov 28, 2018
1 parent 2e6e902 commit dc25ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/ast/ast_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ void ast_driver_unload(struct drm_device *dev)
drm_mode_config_cleanup(dev);

ast_mm_fini(ast);
pci_iounmap(dev->pdev, ast->ioregs);
if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET)
pci_iounmap(dev->pdev, ast->ioregs);
pci_iounmap(dev->pdev, ast->regs);
kfree(ast);
}
Expand Down

0 comments on commit dc25ab0

Please sign in to comment.