diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-07-08 12:24:52 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-02 14:21:37 +1000 |
commit | e0a2ca737597de5068634df2706f4cf1c1e32d84 (patch) | |
tree | 4e4cfde94b3bad76009b6b021b90188b92bba30f /drivers/gpu | |
parent | ab9e1f5966591dc3e811418e96ba04f284c52458 (diff) | |
download | linux-e0a2ca737597de5068634df2706f4cf1c1e32d84.tar.bz2 |
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: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 0fea894fc127..a64811a94519 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -737,7 +737,8 @@ void radeon_device_fini(struct radeon_device *rdev) destroy_workqueue(rdev->wq); vga_switcheroo_unregister_client(rdev->pdev); vga_client_register(rdev->pdev, NULL, NULL, NULL); - pci_iounmap(rdev->pdev, rdev->rio_mem); + if (rdev->rio_mem) + pci_iounmap(rdev->pdev, rdev->rio_mem); rdev->rio_mem = NULL; iounmap(rdev->rmmio); rdev->rmmio = NULL; |