]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: gpt: avoid unnecessary pmbr check
authorDavidlohr Bueso <davidlohr@hp.com>
Sun, 22 Sep 2013 03:45:14 +0000 (20:45 -0700)
committerKarel Zak <kzak@redhat.com>
Wed, 25 Sep 2013 09:13:38 +0000 (11:13 +0200)
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 <davidlohr@hp.com>
libfdisk/src/gpt.c

index 908da992239ad39487892cebd289e1be747de522..155745d2602864b0cf6fbdbf4b1aee4eb00c8c07 100644 (file)
@@ -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))