Skip to content

Commit 94be476

Browse files
Sam Bobroffgregkh
authored andcommitted
drm/ast: Fix incorrect free on ioregs
commit dc25ab0 upstream. 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 <sbobroff@linux.ibm.com> Cc: <stable@vger.kernel.org> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 81f9662 commit 94be476

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/gpu/drm/ast/ast_main.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,8 @@ void ast_driver_unload(struct drm_device *dev)
583583
drm_mode_config_cleanup(dev);
584584

585585
ast_mm_fini(ast);
586-
pci_iounmap(dev->pdev, ast->ioregs);
586+
if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET)
587+
pci_iounmap(dev->pdev, ast->ioregs);
587588
pci_iounmap(dev->pdev, ast->regs);
588589
kfree(ast);
589590
}

0 commit comments

Comments
 (0)