Message ID | 1312201870-12921-6-git-send-email-jamie@jamieiles.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h index c519610..8763328 100644 --- a/arch/arm/mach-orion5x/include/mach/io.h +++ b/arch/arm/mach-orion5x/include/mach/io.h @@ -20,6 +20,10 @@ __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype) { void __iomem *retval; unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE; + + if (!size) + return NULL; + if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE && size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) { retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
Without __arch_ioremap(), __get_vm_area_node() with a zero size will return a NULL pointer. Make the arch specific ioremap() do the same thing. Cc: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: Jamie Iles <jamie@jamieiles.com> --- arch/arm/mach-orion5x/include/mach/io.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)