Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165463
b: refs/heads/master
c: 4c1e6b2
h: refs/heads/master
i:
  165461: 8003680
  165459: e78037c
  165455: a3b6d1b
v: v3
  • Loading branch information
Roel Kluin authored and David Woodhouse committed Sep 19, 2009
1 parent 805836a commit 0ecce88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f12a9473283e68ae708e9ada37cb352ea2652397
refs/heads/master: 4c1e6b2ce13b154a4a69cee220c98976f4b784df
6 changes: 4 additions & 2 deletions trunk/drivers/mtd/devices/lart.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ static int flash_erase (struct mtd_info *mtd,struct erase_info *instr)
* erase range is aligned with the erase size which is in
* effect here.
*/
if (instr->addr & (mtd->eraseregions[i].erasesize - 1)) return (-EINVAL);
if (i < 0 || (instr->addr & (mtd->eraseregions[i].erasesize - 1)))
return -EINVAL;

/* Remember the erase region we start on */
first = i;
Expand All @@ -409,7 +410,8 @@ static int flash_erase (struct mtd_info *mtd,struct erase_info *instr)
i--;

/* is the end aligned on a block boundary? */
if ((instr->addr + instr->len) & (mtd->eraseregions[i].erasesize - 1)) return (-EINVAL);
if (i < 0 || ((instr->addr + instr->len) & (mtd->eraseregions[i].erasesize - 1)))
return -EINVAL;

addr = instr->addr;
len = instr->len;
Expand Down

0 comments on commit 0ecce88

Please sign in to comment.