Commit e0a2ca73 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms: make sure rio_mem is valid before unmapping it

If we were not able to map the io bar in device init, don't attempt
to unmap it in device fini.  All radeons should have a io bar, so
I doubt this would ever trigger, but just to be on the safe side...

Pointed out by: Alberto Milone <alberto.milone@canonical.com>
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ab9e1f59
...@@ -737,6 +737,7 @@ void radeon_device_fini(struct radeon_device *rdev) ...@@ -737,6 +737,7 @@ void radeon_device_fini(struct radeon_device *rdev)
destroy_workqueue(rdev->wq); destroy_workqueue(rdev->wq);
vga_switcheroo_unregister_client(rdev->pdev); vga_switcheroo_unregister_client(rdev->pdev);
vga_client_register(rdev->pdev, NULL, NULL, NULL); vga_client_register(rdev->pdev, NULL, NULL, NULL);
if (rdev->rio_mem)
pci_iounmap(rdev->pdev, rdev->rio_mem); pci_iounmap(rdev->pdev, rdev->rio_mem);
rdev->rio_mem = NULL; rdev->rio_mem = NULL;
iounmap(rdev->rmmio); iounmap(rdev->rmmio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment