From: Mike Frysinger Date: Tue, 18 Nov 2008 09:48:22 +0000 (+0800) Subject: Blackfin arch: fix off-by-one errors on end of memory range X-Git-Tag: firefly_0821_release~16089^2~117 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=89c6c139a57e27617850ddc7df90e267374a1a5c;p=firefly-linux-kernel-4.4.55.git Blackfin arch: fix off-by-one errors on end of memory range Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index a895927fcc30..2af3a886c145 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -643,7 +643,7 @@ int kgdb_ebin2mem(char *buf, char *mem, int count) return EFAULT; } } else if ((cpu == 0 && (unsigned int)mem >= L1_CODE_START && - (unsigned int)(mem + count) < L1_CODE_START + L1_CODE_LENGTH) + (unsigned int)(mem + count) <= L1_CODE_START + L1_CODE_LENGTH) #ifdef CONFIG_SMP || (cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START && (unsigned int)(mem + count) <= @@ -758,11 +758,11 @@ int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr) if ((cpu == 0 && (unsigned int)addr >= L1_CODE_START && (unsigned int)(addr + BREAK_INSTR_SIZE) - < L1_CODE_START + L1_CODE_LENGTH) + <= L1_CODE_START + L1_CODE_LENGTH) #ifdef CONFIG_SMP || (cpu == 1 && (unsigned int)addr >= COREB_L1_CODE_START && (unsigned int)(addr + BREAK_INSTR_SIZE) - < COREB_L1_CODE_START + L1_CODE_LENGTH) + <= COREB_L1_CODE_START + L1_CODE_LENGTH) #endif ) { /* access L1 instruction SRAM */ @@ -789,7 +789,7 @@ int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr) int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle) { if ((unsigned int)addr >= L1_CODE_START && - (unsigned int)(addr + BREAK_INSTR_SIZE) < + (unsigned int)(addr + BREAK_INSTR_SIZE) <= L1_CODE_START + L1_CODE_LENGTH) { /* access L1 instruction SRAM */ if (dma_memcpy((void *)addr, bundle, BREAK_INSTR_SIZE) == NULL)