aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2005-10-19 06:57:14 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:32:44 -0400
commit750ccf687ff9adbf2a16066a3a2757d0f761384c (patch)
tree935c776cb9927f34b7038247249e4de68c93a562 /arch
parentf4c72cc737561aab0d9c7f877abbc0a853f1c465 (diff)
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 <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/mm/cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 611b48dde737..314701a66b13 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -56,6 +56,8 @@ EXPORT_SYMBOL(_dma_cache_inv);
56asmlinkage int sys_cacheflush(unsigned long __user addr, 56asmlinkage int sys_cacheflush(unsigned long __user addr,
57 unsigned long bytes, unsigned int cache) 57 unsigned long bytes, unsigned int cache)
58{ 58{
59 if (bytes == 0)
60 return 0;
59 if (!access_ok(VERIFY_WRITE, (void __user *) addr, bytes)) 61 if (!access_ok(VERIFY_WRITE, (void __user *) addr, bytes))
60 return -EFAULT; 62 return -EFAULT;
61 63