diff mbox series

acpi: madt: De-initialise ACPICA core engine in case of error.

Message ID 20211116120201.247289-1-gjb@semihalf.com
State Accepted
Headers show
Series acpi: madt: De-initialise ACPICA core engine in case of error. | expand

Commit Message

Grzegorz Bernacki Nov. 16, 2021, 12:02 p.m. UTC
fwts_acpica_deinit() should be called if madt_init() fails.

Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
---
 src/acpi/madt/madt.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Alex Hung Nov. 22, 2021, 1:51 a.m. UTC | #1
On 2021-11-16 5:02 a.m., Grzegorz Bernacki wrote:
> fwts_acpica_deinit() should be called if madt_init() fails.
> 
> Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
> ---
>  src/acpi/madt/madt.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
> index 7173023a..5892176b 100644
> --- a/src/acpi/madt/madt.c
> +++ b/src/acpi/madt/madt.c
> @@ -432,6 +432,9 @@ PRAGMA_NULL_PTR_MATH
>  PRAGMA_POP
>  	AcpiGetDevices("ACPI0007", madt_processor_handler, NULL, NULL);
>  
> +	if (!spec_data)
> +		fwts_acpica_deinit();
> +
>  	return (spec_data) ? FWTS_OK : FWTS_ERROR;
>  }
>  
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
ivanhu Nov. 23, 2021, 2:06 a.m. UTC | #2
On 11/16/21 8:02 PM, Grzegorz Bernacki wrote:
> fwts_acpica_deinit() should be called if madt_init() fails.
> 
> Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
> ---
>  src/acpi/madt/madt.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
> index 7173023a..5892176b 100644
> --- a/src/acpi/madt/madt.c
> +++ b/src/acpi/madt/madt.c
> @@ -432,6 +432,9 @@ PRAGMA_NULL_PTR_MATH
>  PRAGMA_POP
>  	AcpiGetDevices("ACPI0007", madt_processor_handler, NULL, NULL);
>  
> +	if (!spec_data)
> +		fwts_acpica_deinit();
> +
>  	return (spec_data) ? FWTS_OK : FWTS_ERROR;
>  }
>  
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index 7173023a..5892176b 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -432,6 +432,9 @@  PRAGMA_NULL_PTR_MATH
 PRAGMA_POP
 	AcpiGetDevices("ACPI0007", madt_processor_handler, NULL, NULL);
 
+	if (!spec_data)
+		fwts_acpica_deinit();
+
 	return (spec_data) ? FWTS_OK : FWTS_ERROR;
 }