Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298190
b: refs/heads/master
c: a7baef1
h: refs/heads/master
v: v3
  • Loading branch information
Robert Jarzmik authored and David Woodhouse committed Mar 27, 2012
1 parent 4ac71fb commit 01f52f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: a78da28776496d3a850ce741d3474b65057e156b
refs/heads/master: a7baef1211b0ac218299965481e7cff9d68c1edd
17 changes: 5 additions & 12 deletions trunk/drivers/mtd/devices/docg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,8 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t from,
if (ooblen % DOC_LAYOUT_OOB_SIZE)
return -EINVAL;

ret = -EINVAL;
calc_block_sector(from + len, &block0, &block1, &page, &ofs,
docg3->reliable);
if (block1 > docg3->max_block)
goto err;
if (from + len > mtd->size)
return -EINVAL;

ops->oobretlen = 0;
ops->retlen = 0;
Expand Down Expand Up @@ -1207,7 +1204,7 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *info)
calc_block_sector(info->addr + info->len, &block0, &block1, &page,
&ofs, docg3->reliable);
ret = -EINVAL;
if (block1 > docg3->max_block || page || ofs)
if (info->addr + info->len > mtd->size || page || ofs)
goto reset_err;

ret = 0;
Expand Down Expand Up @@ -1443,12 +1440,8 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
if (len && ooblen &&
(len / DOC_LAYOUT_PAGE_SIZE) != (ooblen / oobdelta))
return -EINVAL;

ret = -EINVAL;
calc_block_sector(ofs + len, &block0, &block1, &page, &pofs,
docg3->reliable);
if (block1 > docg3->max_block)
goto err;
if (ofs + len > mtd->size)
return -EINVAL;

ops->oobretlen = 0;
ops->retlen = 0;
Expand Down

0 comments on commit 01f52f6

Please sign in to comment.