Commit 1f3a8bae authored by Matt Fleming's avatar Matt Fleming

x86/efi: Fix earlyprintk off-by-one bug

Dave reported seeing the following incorrect output on his Thinkpad T420
when using earlyprintk=efi,

[    0.000000] efi: EFI v2.00 by Lenovo
                    ACPI=0xdabfe000  ACPI 2.0=0xdabfe014 SMBIOS=0xdaa9e000

The output should be on one line, not split over two. The cause is an
off-by-one error when checking that the efi_y coordinate hasn't been
incremented out of bounds.
Reported-by: default avatarDave Young <dyoung@redhat.com>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent e0d59733
...@@ -142,7 +142,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num) ...@@ -142,7 +142,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num)
efi_y += font->height; efi_y += font->height;
} }
if (efi_y + font->height >= si->lfb_height) { if (efi_y + font->height > si->lfb_height) {
u32 i; u32 i;
efi_y -= font->height; efi_y -= font->height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment