platform: msm_shared: Fix max number of partition table entries
Max number of partition table entries is defined to 32, but the
gpt/mbr spec does not have any hard limit on the max entries.
Increase the max value to a safer number to 128.
CRs-Fixed: 551703
Change-Id: I93c9e98f3efb8fa85f99225e944ae86f834f7b5a
diff --git a/platform/msm_shared/partition_parser.c b/platform/msm_shared/partition_parser.c
index e2d548e..6facb93 100644
--- a/platform/msm_shared/partition_parser.c
+++ b/platform/msm_shared/partition_parser.c
@@ -58,7 +58,7 @@
unsigned int ext3_count = 0;
unsigned int vfat_count = 0;
-struct partition_entry partition_entries[NUM_PARTITIONS];
+struct partition_entry *partition_entries;
static unsigned gpt_partitions_exist = 0;
unsigned partition_count = 0;
@@ -69,6 +69,10 @@
block_size = mmc_get_device_blocksize();
+ /* Allocate partition entries array */
+ partition_entries = (struct partition_entry *) calloc(NUM_PARTITIONS, sizeof(struct partition_entry));
+ ASSERT(partition_entries);
+
/* Read MBR of the card */
ret = mmc_boot_read_mbr(block_size);
if (ret) {