summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Langsdorf <mark.langsdorf@calxeda.com>2013-09-10 15:14:56 -0500
committerTom Rini <trini@ti.com>2013-09-20 10:30:53 -0400
commit6d2ee5a33a802e6c59ba3148b3a111e4c41d43cb (patch)
treed00a6d4d138869b7b9a58fe17b9b52debf3ed9b8
parent8094972d594d883e3e556751f67ff5cdd8a286c5 (diff)
downloadu-boot-imx-6d2ee5a33a802e6c59ba3148b3a111e4c41d43cb.zip
u-boot-imx-6d2ee5a33a802e6c59ba3148b3a111e4c41d43cb.tar.gz
u-boot-imx-6d2ee5a33a802e6c59ba3148b3a111e4c41d43cb.tar.bz2
part_efi: make sure the gpt_pte is freed
the gpt_pte wasn't being freed if it was checked against an invalid partition. The resulting memory leakage could make it impossible to repeatedly attempt to load non-existent files in a script. Also, downgrade the message for not finding an invalid partition from a printf() to a debug() so as to minimize message spam in perfectly normal situations. Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
-rw-r--r--disk/part_efi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index b7524d6..9c33ae7 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -164,8 +164,9 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
if (part > le32_to_cpu(gpt_head->num_partition_entries) ||
!is_pte_valid(&gpt_pte[part - 1])) {
- printf("%s: *** ERROR: Invalid partition number %d ***\n",
+ debug("%s: *** ERROR: Invalid partition number %d ***\n",
__func__, part);
+ free(gpt_pte);
return -1;
}