Re: [PATCH 7/9] ACPI: EC: Put the ACPI table after using it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020/5/9 17:30, Rafael J. Wysocki wrote:
On Saturday, May 9, 2020 11:11:26 AM CEST Rafael J. Wysocki wrote:
On Thursday, May 7, 2020 11:09:19 AM CEST Hanjun Guo wrote:
The embedded controller boot resources table needs to be
released after using it.

Signed-off-by: Hanjun Guo <guohanjun@xxxxxxxxxx>
---
  drivers/acpi/ec.c | 14 ++++++++++----
  1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index b4c0152e..281a9bf 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1784,12 +1784,15 @@ static void __init acpi_ec_ecdt_start(void)
status = acpi_get_handle(NULL, ecdt_ptr->id, &handle);
  	if (ACPI_FAILURE(status))
-		return;
+		goto out;

So to avoid adding a new label I would prefer

if (ACPI_SUCCESS(status)) {
	boot_ec->handle = handle;

	/* Add a special ACPI device object to represent the boot EC. */
	acpi_bus_register_early_device(ACPI_BUS_TYPE_ECDT_EC);
}

  	boot_ec->handle = handle;
/* Add a special ACPI device object to represent the boot EC. */
  	acpi_bus_register_early_device(ACPI_BUS_TYPE_ECDT_EC);
+
+out:
+	acpi_put_table((struct acpi_table_header *)ecdt_ptr);
  }

I've made the above change manually and applied the whole series as 5.8
material.

Thank you very much!




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux