diff options
Diffstat (limited to 'arch/x86/pci/common.c')
-rw-r--r-- | arch/x86/pci/common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index ccd0ab3ab899..f24ba14e80b1 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -618,7 +618,9 @@ int pcibios_add_device(struct pci_dev *dev) pa_data = boot_params.hdr.setup_data; while (pa_data) { - data = phys_to_virt(pa_data); + data = ioremap(pa_data, sizeof(*rom)); + if (!data) + return -ENOMEM; if (data->type == SETUP_PCI) { rom = (struct pci_setup_rom *)data; @@ -635,6 +637,7 @@ int pcibios_add_device(struct pci_dev *dev) } } pa_data = data->next; + iounmap(data); } return 0; } |