[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220324175417.1014562-2-f.fainelli@gmail.com>
Date: Thu, 24 Mar 2022 10:54:16 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: linux-arm-kernel@...ts.infradead.org
Cc: Florian Fainelli <f.fainelli@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Russell King <linux@...linux.org.uk>,
Nicolas Pitre <nico@...xnic.net>,
Catalin Marinas <catalin.marinas@....com>,
linux-kernel@...r.kernel.org (open list),
linus.walleij@...aro.org, Rob Herring <robh+dt@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>
Subject: [PATCH 1/2] ARM: Fix off by one in checking DMA zone size
The maximum DMA address is PAGE_OFFSET + arm_dma_zone_size - 1, fix this
by doing the appropriate subtraction.
Fixes: 650320181a08 ("ARM: change ARM_DMA_ZONE_SIZE into a variable")
Suggested-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
arch/arm/include/asm/dma.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index a81dda65c576..f244ee68e814 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -11,7 +11,7 @@
#define MAX_DMA_ADDRESS ({ \
extern phys_addr_t arm_dma_zone_size; \
arm_dma_zone_size && arm_dma_zone_size < (0x10000000 - PAGE_OFFSET) ? \
- (PAGE_OFFSET + arm_dma_zone_size) : 0xffffffffUL; })
+ (PAGE_OFFSET + arm_dma_zone_size - 1) : 0xffffffffUL; })
#endif
#ifdef CONFIG_ISA_DMA_API
--
2.25.1
Powered by blists - more mailing lists