X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Fmips%2Fcpu%2Fmips32%2Fcpu.c;h=7b49e1b612b70b876e6b78c27d4a52a7dc176b2b;hb=037e9d33db9fc86c1e671d64077b2d1a19df7f24;hp=3ae397c8eff4160f6d37102016fbf7e634b591b1;hpb=91809608a44f7d90be4c630f09c9de54cc3852d8;p=oweals%2Fu-boot.git diff --git a/arch/mips/cpu/mips32/cpu.c b/arch/mips/cpu/mips32/cpu.c index 3ae397c8ef..7b49e1b612 100644 --- a/arch/mips/cpu/mips32/cpu.c +++ b/arch/mips/cpu/mips32/cpu.c @@ -56,6 +56,10 @@ void flush_cache(ulong start_addr, ulong size) unsigned long addr = start_addr & ~(lsize - 1); unsigned long aend = (start_addr + size - 1) & ~(lsize - 1); + /* aend will be miscalculated when size is zero, so we return here */ + if (size == 0) + return; + while (1) { cache_op(Hit_Writeback_Inv_D, addr); cache_op(Hit_Invalidate_I, addr);