From: Atsushi Nemoto Date: Wed, 19 Oct 2005 10:57:14 +0000 (+0900) Subject: Fix zero length sys_cacheflush X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=750ccf687ff9adbf2a16066a3a2757d0f761384c;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Fix zero length sys_cacheflush Cacheflush(0, 0, 0) was crashing the system. This is because flush_icache_range(start, end) tries to flushing whole address space (0 - ~0UL) if both start and end are zero. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 611b48dde73..314701a66b1 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c @@ -56,6 +56,8 @@ EXPORT_SYMBOL(_dma_cache_inv); asmlinkage int sys_cacheflush(unsigned long __user addr, unsigned long bytes, unsigned int cache) { + if (bytes == 0) + return 0; if (!access_ok(VERIFY_WRITE, (void __user *) addr, bytes)) return -EFAULT;