Skip to contentSkip to conversation

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

PATCH New Alex Deucher 1 participant 1 message Jul 8, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>

---
 drivers/gpu/drm/radeon/radeon_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/radeon_device.c +2 -1
index d3e86f4..9b092b6 100644
@@ -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;
Signature · 1 line
1.7.0.1