aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/cfi_flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 5ba0c5fdecb..61c2e6379db 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -761,8 +761,8 @@ static flash_sect_t find_sector(flash_info_t *info, ulong addr)
if (info != saved_info || sector >= info->sector_count)
sector = 0;
- while ((info->start[sector] < addr) &&
- (sector < info->sector_count - 1))
+ while ((sector < info->sector_count - 1) &&
+ (info->start[sector] < addr))
sector++;
while ((info->start[sector] > addr) && (sector > 0))
/*