From ac920fed6cce7ad84e25eeb8df38d8e966c52946 Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Sat, 21 Sep 2013 20:45:14 -0700 Subject: [PATCH] libfdisk: gpt: avoid unnecessary pmbr check We only jump to the 'check_hybrid' label when a valid pmbr is detected, so we need not recheck again. Move the label's logic so it doesn't include the check. Signed-off-by: Davidlohr Bueso --- libfdisk/src/gpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 908da99223..155745d260 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -490,9 +490,10 @@ static int valid_pmbr(struct fdisk_context *cxt) goto check_hybrid; } } -check_hybrid: + if (ret != GPT_MBR_PROTECTIVE) goto done; +check_hybrid: for (i = 0 ; i < 4; i++) { if ((pmbr->partition_record[i].os_type != EFI_PMBR_OSTYPE) && (pmbr->partition_record[i].os_type != 0x00)) -- 2.47.3