Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: memory: Add missing brackets to untagged_addr() macro

Add brackets around the evaluation of the 'addr' parameter to the
untagged_addr() macro so that the cast to 'u64' applies to the result
of the expression.

Cc: <stable@vger.kernel.org>
Fixes: 597399d0cb91 ("arm64: tags: Preserve tags for addresses translated via TTBR1")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Will Deacon <will@kernel.org>

+1 -1
+1 -1
arch/arm64/include/asm/memory.h
··· 213 213 ((__force __typeof__(addr))sign_extend64((__force u64)(addr), 55)) 214 214 215 215 #define untagged_addr(addr) ({ \ 216 - u64 __addr = (__force u64)addr; \ 216 + u64 __addr = (__force u64)(addr); \ 217 217 __addr &= __untagged_addr(__addr); \ 218 218 (__force __typeof__(addr))__addr; \ 219 219 })