From: Alexander Graf Date: Mon, 4 Dec 2017 15:33:26 +0000 (+0100) Subject: efi_stub: Fix GDT_NOTSYS check X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=14d61d4e577c57ba77b826c6cc9d99a0b3f3fc37;p=u-boot.git efi_stub: Fix GDT_NOTSYS check The get_codeseg32() wants to know if a passed in descriptor has flag GDT_NOTSYS set (desc & GDT_NOTSYS), not whether desc and GDT_NOTSYS are not != 0 (desk && GDT_NOTSYS). This is an obvious typo. Fix it up. Signed-off-by: Alexander Graf Reviewed-by: Bin Meng --- diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c index 2e8d409d31..205aa19947 100644 --- a/lib/efi/efi_stub.c +++ b/lib/efi/efi_stub.c @@ -182,7 +182,7 @@ static int get_codeseg32(void) << 16; base <<= 12; /* 4KB granularity */ limit <<= 12; - if ((desc & GDT_PRESENT) && (desc && GDT_NOTSYS) && + if ((desc & GDT_PRESENT) && (desc & GDT_NOTSYS) && !(desc & GDT_LONG) && (desc & GDT_4KB) && (desc & GDT_32BIT) && (desc & GDT_CODE) && CONFIG_SYS_TEXT_BASE > base &&