Merge branches 'acpi-button', 'acpica' and 'acpi-sysfs'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Jun 2017 22:03:29 +0000 (00:03 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Jun 2017 22:03:29 +0000 (00:03 +0200)
* acpi-button:
  Revert "ACPI / button: Change default behavior to lid_init_state=open"

* acpica:
  ACPICA: Tables: Fix regression introduced by a too early mechanism enabling

* acpi-sysfs:
  ACPI / sysfs: fix acpi_get_table() leak / acpi-sysfs denial of service

drivers/acpi/acpica/tbutils.c
drivers/acpi/button.c
drivers/acpi/sysfs.c

index 5a968a78652bd23d269fbc871957a4488fb03af6..7abe6650573950674ce41a7511fd9abe2736c451 100644 (file)
@@ -418,11 +418,7 @@ acpi_tb_get_table(struct acpi_table_desc *table_desc,
 
        table_desc->validation_count++;
        if (table_desc->validation_count == 0) {
-               ACPI_ERROR((AE_INFO,
-                           "Table %p, Validation count is zero after increment\n",
-                           table_desc));
                table_desc->validation_count--;
-               return_ACPI_STATUS(AE_LIMIT);
        }
 
        *out_table = table_desc->pointer;
index 25aba9b107dd51db522225b5171e7017a5a3ec9d..9ad8cdb58743b765a6daa615729d78745d70af30 100644 (file)
@@ -113,7 +113,7 @@ struct acpi_button {
 
 static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier);
 static struct acpi_device *lid_device;
-static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
+static u8 lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
 
 static unsigned long lid_report_interval __read_mostly = 500;
 module_param(lid_report_interval, ulong, 0644);
index 1b5ee1e0e5a3073457b0b15da34aadf292a544ba..e414fabf73158d77fba356be2c10354647e81a44 100644 (file)
@@ -333,14 +333,17 @@ static ssize_t acpi_table_show(struct file *filp, struct kobject *kobj,
            container_of(bin_attr, struct acpi_table_attr, attr);
        struct acpi_table_header *table_header = NULL;
        acpi_status status;
+       ssize_t rc;
 
        status = acpi_get_table(table_attr->name, table_attr->instance,
                                &table_header);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
-       return memory_read_from_buffer(buf, count, &offset,
-                                      table_header, table_header->length);
+       rc = memory_read_from_buffer(buf, count, &offset, table_header,
+                       table_header->length);
+       acpi_put_table(table_header);
+       return rc;
 }
 
 static int acpi_table_attr_init(struct kobject *tables_obj,