Commit 6d2ee5a33a802e6c59ba3148b3a111e4c41d43cb

Authored by Mark Langsdorf
Committed by Tom Rini
1 parent 8094972d59

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>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -164,8 +164,9 @@
164 164  
165 165 if (part > le32_to_cpu(gpt_head->num_partition_entries) ||
166 166 !is_pte_valid(&gpt_pte[part - 1])) {
167   - printf("%s: *** ERROR: Invalid partition number %d ***\n",
  167 + debug("%s: *** ERROR: Invalid partition number %d ***\n",
168 168 __func__, part);
  169 + free(gpt_pte);
169 170 return -1;
170 171 }
171 172