Skip to content

Commit

Permalink
x86/efi: Fix earlyprintk off-by-one bug
Browse files Browse the repository at this point in the history
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: Dave Young <dyoung@redhat.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
  • Loading branch information
Matt Fleming committed Nov 28, 2013
1 parent e0d5973 commit 1f3a8ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/platform/efi/early_printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num)
efi_y += font->height;
}

if (efi_y + font->height >= si->lfb_height) {
if (efi_y + font->height > si->lfb_height) {
u32 i;

efi_y -= font->height;
Expand Down

0 comments on commit 1f3a8ba

Please sign in to comment.