mtd: bcm47xxpart: fix off by one in partitions limit
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:

committed by
Brian Norris

parent
670b46aa6c
commit
00b79860eb
@@ -91,7 +91,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,
|
|||||||
if (offset >= 0x2000000)
|
if (offset >= 0x2000000)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (curr_part > BCM47XXPART_MAX_PARTS) {
|
if (curr_part >= BCM47XXPART_MAX_PARTS) {
|
||||||
pr_warn("Reached maximum number of partitions, scanning stopped!\n");
|
pr_warn("Reached maximum number of partitions, scanning stopped!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,
|
|||||||
|
|
||||||
/* Look for NVRAM at the end of the last block. */
|
/* Look for NVRAM at the end of the last block. */
|
||||||
for (i = 0; i < ARRAY_SIZE(possible_nvram_sizes); i++) {
|
for (i = 0; i < ARRAY_SIZE(possible_nvram_sizes); i++) {
|
||||||
if (curr_part > BCM47XXPART_MAX_PARTS) {
|
if (curr_part >= BCM47XXPART_MAX_PARTS) {
|
||||||
pr_warn("Reached maximum number of partitions, scanning stopped!\n");
|
pr_warn("Reached maximum number of partitions, scanning stopped!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user