Skip to content

Commit

Permalink
ACPI: Make sure the FADT is at least rev 2 before using the reset reg…
Browse files Browse the repository at this point in the history
…ister

The reset register was only introduced with version 2 of the FADT, so we
should check that the FADT revision before trusting its contents.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Matthew Garrett authored and Len Brown committed Mar 23, 2011
1 parent 6734fe5 commit 95cf3e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/acpi/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ void acpi_reboot(void)

rr = &acpi_gbl_FADT.reset_register;

/* ACPI reset register was only introduced with v2 of the FADT */

if (acpi_gbl_FADT.header.revision < 2)
return;

/* Is the reset register supported? The spec says we should be
* checking the bit width and bit offset, but Windows ignores
* these fields */
Expand Down

0 comments on commit 95cf3e1

Please sign in to comment.