Message ID | 20241005233758.708112-1-W_Armin@gmx.de |
---|---|
State | Superseded |
Headers | show |
Series | [1/2] lib: fwts_acpi_object_eval: Do not return FWTS_OK if method lookup fails | expand |
Acked-by: Ivan Hu <ivan.hu@canonical.com> On 10/6/24 07:37, Armin Wolf wrote: > If for some reason the lookup of an ACPI method fails with an error > different than AE_NOT_FOUND, FWTS_OK is returned. > > Fix this by instead returning FWTS_ERROR in such cases. > > Signed-off-by: Armin Wolf <W_Armin@gmx.de> > --- > src/lib/src/fwts_acpi_object_eval.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c > index 37f67eb8..1c2de735 100644 > --- a/src/lib/src/fwts_acpi_object_eval.c > +++ b/src/lib/src/fwts_acpi_object_eval.c > @@ -1222,6 +1222,13 @@ int fwts_evaluate_method(fwts_framework *fw, > } > } > > + if (ACPI_FAILURE(status)) { > + const char *exception = AcpiFormatException(status); > + fwts_log_info(fw, "ACPICA Exception %s during lookup of method %s", > + exception, name); > + return FWTS_ERROR; > + } > + > return FWTS_OK; > } > > -- > 2.39.5 > >
diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c index 37f67eb8..1c2de735 100644 --- a/src/lib/src/fwts_acpi_object_eval.c +++ b/src/lib/src/fwts_acpi_object_eval.c @@ -1222,6 +1222,13 @@ int fwts_evaluate_method(fwts_framework *fw, } } + if (ACPI_FAILURE(status)) { + const char *exception = AcpiFormatException(status); + fwts_log_info(fw, "ACPICA Exception %s during lookup of method %s", + exception, name); + return FWTS_ERROR; + } + return FWTS_OK; }
If for some reason the lookup of an ACPI method fails with an error different than AE_NOT_FOUND, FWTS_OK is returned. Fix this by instead returning FWTS_ERROR in such cases. Signed-off-by: Armin Wolf <W_Armin@gmx.de> --- src/lib/src/fwts_acpi_object_eval.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.39.5