Skip to content

Commit

Permalink
tools/acpixtract: handle AX_OPTIONAL_TABLES correctly
Browse files Browse the repository at this point in the history
The previous commit introduced a regression while attempting to make
acpixtract not exit with -1 in case of a missing optional table.

Add an extra condition that checks that the number of detected instances
was 0 before checking AX_OPTIONAL_TABLES.

Fixes: ad5755d ("acpixtract: don't abort AxExtractTables for AX_OPTIONAL_TABLES")
Resolves: acpica#978
Signed-off-by: Daniil Tatianin <99danilt@gmail.com>
  • Loading branch information
d-tatianin committed Oct 20, 2024
1 parent dba0e37 commit 0f0b704
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/tools/acpixtract/acpixtract.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ AxExtractTables (
AxNormalizeSignature (UpperSignature);
Instances = AxCountTableInstances (InputPathname, UpperSignature);

if (Instances < MinimumInstances || MinimumInstances == AX_OPTIONAL_TABLES)
if (Instances < MinimumInstances ||
(Instances == 0 && MinimumInstances == AX_OPTIONAL_TABLES))
{
printf ("Table [%s] was not found in %s\n",
UpperSignature, InputPathname);
Expand Down

0 comments on commit 0f0b704

Please sign in to comment.