Message ID | 1527596299-57567-2-git-send-email-xieyisheng1@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 0eb0381..117ca6a 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3547,6 +3547,9 @@ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) if (!PAGE_ALIGNED(vaddr) || !PAGE_ALIGNED(resource_size(res))) return -EINVAL; + if (!PAGE_ALIGNED(phys_addr)) + return -EINVAL; + return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr, pgprot_device(PAGE_KERNEL)); #else