diff options
author | Aubrey Li <aubrey.li@intel.com> | 2021-08-06 03:46:24 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-08-16 18:06:40 +0300 |
commit | 2bbfa0addd63fd06756b7af8bf146ae166e2abf5 (patch) | |
tree | 8db19f551231f382e004463c5e195175e89b6e3e /drivers/acpi | |
parent | 7c60610d476766e128cc4284bb6349732cbd6606 (diff) | |
download | linux-2bbfa0addd63fd06756b7af8bf146ae166e2abf5.tar.xz |
ACPI: PRM: Deal with table not present or no module found
On the system PRMT table is not present, dmesg output:
$ dmesg | grep PRM
[ 1.532237] ACPI: PRMT not present
[ 1.532237] PRM: found 4294967277 modules
The result of acpi_table_parse_entries need to be checked and return
immediately if PRMT table is not present or no PRM module found.
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/prmt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index 31cf9aee5edd..1f6007abcf18 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -292,6 +292,12 @@ void __init init_prmt(void) int mc = acpi_table_parse_entries(ACPI_SIG_PRMT, sizeof(struct acpi_table_prmt) + sizeof (struct acpi_table_prmt_header), 0, acpi_parse_prmt, 0); + /* + * Return immediately if PRMT table is not present or no PRM module found. + */ + if (mc <= 0) + return; + pr_info("PRM: found %u modules\n", mc); status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT, |