aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/common.c')
-rw-r--r--arch/x86/pci/common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 305c68b8d538..981c2dbd72cc 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -628,7 +628,9 @@ int pcibios_add_device(struct pci_dev *dev)
628 628
629 pa_data = boot_params.hdr.setup_data; 629 pa_data = boot_params.hdr.setup_data;
630 while (pa_data) { 630 while (pa_data) {
631 data = phys_to_virt(pa_data); 631 data = ioremap(pa_data, sizeof(*rom));
632 if (!data)
633 return -ENOMEM;
632 634
633 if (data->type == SETUP_PCI) { 635 if (data->type == SETUP_PCI) {
634 rom = (struct pci_setup_rom *)data; 636 rom = (struct pci_setup_rom *)data;
@@ -645,6 +647,7 @@ int pcibios_add_device(struct pci_dev *dev)
645 } 647 }
646 } 648 }
647 pa_data = data->next; 649 pa_data = data->next;
650 iounmap(data);
648 } 651 }
649 return 0; 652 return 0;
650} 653}