Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61214
b: refs/heads/master
c: 4ab60a0
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 18, 2007
1 parent 5b2f61b commit a7fb284
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 78d87c95b89ccf86c142494beada3082810ed368
refs/heads/master: 4ab60a0d7c92cab16f7e470f80ea039a0b174bce
11 changes: 8 additions & 3 deletions trunk/drivers/mtd/ubi/kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,14 @@ int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
offset + len > vol->usable_leb_size)
return -EINVAL;

if (vol->vol_type == UBI_STATIC_VOLUME && lnum == vol->used_ebs - 1 &&
offset + len > vol->last_eb_bytes)
return -EINVAL;
if (vol->vol_type == UBI_STATIC_VOLUME) {
if (vol->used_ebs == 0)
/* Empty static UBI volume */
return 0;
if (lnum == vol->used_ebs - 1 &&
offset + len > vol->last_eb_bytes)
return -EINVAL;
}

if (vol->upd_marker)
return -EBADF;
Expand Down

0 comments on commit a7fb284

Please sign in to comment.