Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us> fix end of address space...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 24 Aug 2008 18:09:37 +0000 (18:09 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Sun, 24 Aug 2008 18:09:37 +0000 (18:09 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@961 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/flash.c

index e5adcc861585cbee117e8d1f12c032b3fdf20029..b9c9f5cf5b3b7fd1531f778ce2b5a4b9a1dca649 100644 (file)
@@ -905,7 +905,7 @@ flash_bank_t *get_flash_bank_by_addr(target_t *target, u32 addr)
                        return NULL;
                }
                /* check whether address belongs to this flash bank */
-               if ((addr >= c->base) && (addr < c->base + c->size) && target == c->target)
+               if ((addr >= c->base) && (addr <= c->base + (c->size - 1)) && target == c->target)
                        return c;
        }
        LOG_ERROR("No flash at address 0x%08x\n", addr);