aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/bcm47xxpart.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-02-26 08:02:06 -0500
committerBrian Norris <computersforpeace@gmail.com>2014-03-11 01:42:29 -0400
commit00b79860eb5f72462016046d3841b19ebff6e846 (patch)
treec9b81b7624e565ab6039af2cabd5e17a7195c1b3 /drivers/mtd/bcm47xxpart.c
parent670b46aa6cad88e126c5e7d0f37ed2b41693869d (diff)
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>
Diffstat (limited to 'drivers/mtd/bcm47xxpart.c')
-rw-r--r--drivers/mtd/bcm47xxpart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index de1eb92e42f5..e388e69d853e 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -91,7 +91,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,
91 if (offset >= 0x2000000) 91 if (offset >= 0x2000000)
92 break; 92 break;
93 93
94 if (curr_part > BCM47XXPART_MAX_PARTS) { 94 if (curr_part >= BCM47XXPART_MAX_PARTS) {
95 pr_warn("Reached maximum number of partitions, scanning stopped!\n"); 95 pr_warn("Reached maximum number of partitions, scanning stopped!\n");
96 break; 96 break;
97 } 97 }
@@ -212,7 +212,7 @@ static int bcm47xxpart_parse(struct mtd_info *master,
212 212
213 /* Look for NVRAM at the end of the last block. */ 213 /* Look for NVRAM at the end of the last block. */
214 for (i = 0; i < ARRAY_SIZE(possible_nvram_sizes); i++) { 214 for (i = 0; i < ARRAY_SIZE(possible_nvram_sizes); i++) {
215 if (curr_part > BCM47XXPART_MAX_PARTS) { 215 if (curr_part >= BCM47XXPART_MAX_PARTS) {
216 pr_warn("Reached maximum number of partitions, scanning stopped!\n"); 216 pr_warn("Reached maximum number of partitions, scanning stopped!\n");
217 break; 217 break;
218 } 218 }