Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332751
b: refs/heads/master
c: 7baf042
h: refs/heads/master
i:
  332749: d99bf2f
  332747: 6adc0b7
  332743: 7c2f9e2
  332735: 5eaa78d
v: v3
  • Loading branch information
Shmulik Ladkani authored and David Woodhouse committed Sep 29, 2012
1 parent 1402ef5 commit 037f87e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 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: 2fe87aef33b77d66fada83f5dc57b6798ad5df07
refs/heads/master: 7baf04261062826ea225ab23e07c541e279143fa
12 changes: 11 additions & 1 deletion trunk/drivers/mtd/cmdlinepart.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,22 @@ static int parse_cmdline_partitions(struct mtd_info *master,
if (part->parts[i].size == SIZE_REMAINING)
part->parts[i].size = master->size - offset;

if (part->parts[i].size == 0) {
printk(KERN_WARNING ERRP
"%s: skipping zero sized partition\n",
part->mtd_id);
part->num_parts--;
memmove(&part->parts[i],
&part->parts[i + 1],
sizeof(*part->parts) * (part->num_parts - i));
continue;
}

if (offset + part->parts[i].size > master->size) {
printk(KERN_WARNING ERRP
"%s: partitioning exceeds flash size, truncating\n",
part->mtd_id);
part->parts[i].size = master->size - offset;
part->num_parts = i;
}
offset += part->parts[i].size;
}
Expand Down

0 comments on commit 037f87e

Please sign in to comment.