Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alex Deucher and committed by
Dave Airlie
e0a2ca73 ab9e1f59

+2 -1
+2 -1
drivers/gpu/drm/radeon/radeon_device.c
··· 737 737 destroy_workqueue(rdev->wq); 738 738 vga_switcheroo_unregister_client(rdev->pdev); 739 739 vga_client_register(rdev->pdev, NULL, NULL, NULL); 740 - pci_iounmap(rdev->pdev, rdev->rio_mem); 740 + if (rdev->rio_mem) 741 + pci_iounmap(rdev->pdev, rdev->rio_mem); 741 742 rdev->rio_mem = NULL; 742 743 iounmap(rdev->rmmio); 743 744 rdev->rmmio = NULL;