[PATCH 1/1] disk: incorrect message in is_gpt_valid()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Mon May 9 21:35:44 CEST 2022


alloc_read_gpt_entries() writes differentiated error messages.
The caller is_gpt_valid() should not write an extra possibly wrong message.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 disk/part_efi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 829ccb6bd1..5090efd119 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -1061,10 +1061,8 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
 
 	/* Read and allocate Partition Table Entries */
 	*pgpt_pte = alloc_read_gpt_entries(dev_desc, pgpt_head);
-	if (*pgpt_pte == NULL) {
-		printf("GPT: Failed to allocate memory for PTE\n");
+	if (!*pgpt_pte)
 		return 0;
-	}
 
 	if (validate_gpt_entries(pgpt_head, *pgpt_pte)) {
 		free(*pgpt_pte);
-- 
2.34.1



More information about the U-Boot mailing list