Explorar o código

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>

Atsushi Nemoto %!s(int64=19) %!d(string=hai) anos
pai
achega
750ccf687f
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      arch/mips/mm/cache.c

+ 2 - 0
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;