From 750ccf687ff9adbf2a16066a3a2757d0f761384c Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Wed, 19 Oct 2005 19:57:14 +0900 Subject: [PATCH] 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 --- arch/mips/mm/cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 611b48dde7..314701a66b 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; -- 2.39.5