Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45685
b: refs/heads/master
c: f33665d
h: refs/heads/master
i:
  45683: f46a16c
v: v3
  • Loading branch information
Rod Whitby authored and David Woodhouse committed Dec 8, 2006
1 parent 415c2ed commit db2f047
Show file tree
Hide file tree
Showing 2 changed files with 21 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: dd11b8cdf0c455f4cfbc5daa70aabce9dcc6c07b
refs/heads/master: f33665d931f33a0baf44fc5d3594b23f8118eb44
23 changes: 20 additions & 3 deletions trunk/drivers/mtd/redboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,19 @@ static int parse_redboot_partitions(struct mtd_info *master,
*/
if (swab32(buf[i].size) == master->erasesize) {
int j;
for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) {
for (j = 0; j < numslots; ++j) {

/* A single 0xff denotes a deleted entry.
* Two of them in a row is the end of the table.
*/
if (buf[j].name[0] == 0xff) {
if (buf[j].name[1] == 0xff) {
break;
} else {
continue;
}
}

/* The unsigned long fields were written with the
* wrong byte sex, name and pad have no byte sex.
*/
Expand Down Expand Up @@ -126,8 +138,13 @@ static int parse_redboot_partitions(struct mtd_info *master,
for (i = 0; i < numslots; i++) {
struct fis_list *new_fl, **prev;

if (buf[i].name[0] == 0xff)
continue;
if (buf[i].name[0] == 0xff) {
if (buf[i].name[1] == 0xff) {
break;
} else {
continue;
}
}
if (!redboot_checksum(&buf[i]))
break;

Expand Down

0 comments on commit db2f047

Please sign in to comment.