ColinIanKing / fwts

NOT THE UPSTEAM FWTS REPO, see https://github.com/fwts/fwts instead!
https://wiki.ubuntu.com/Kernel/Reference/fwts
28 stars 11 forks source link

method: \_SB_.NVDR.N000._NIH should return a buffer of 64 bytes, but instead returned 4 bytes. #7

Open liupeng17 opened 2 years ago

liupeng17 commented 2 years ago

On a platform with NVDIMM deivices, fwts reports the errors ``method: _SB_.NVDR.N000._NIH should return a buffer of 64 bytes, but instead returned 4 bytes.'' But according to ACPI spec definition of _NIH, the length of _NIH output buffer is 4 bytes instead of 64 bytes.

Seems fwts/src/lib/src/fwts_acpi_object_eval.c should be changed:

diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c
index 94956896..81c12013 100644
--- a/src/lib/src/fwts_acpi_object_eval.c
+++ b/src/lib/src/fwts_acpi_object_eval.c
@@ -2602,7 +2602,7 @@ void fwts_method_test_NIH_return(
        if (fwts_method_check_type(fw, name, buf, ACPI_TYPE_BUFFER) != FWTS_OK)
                return;

-       if (fwts_method_buffer_size(fw, name, obj, 64) != FWTS_OK)
+       if (fwts_method_buffer_size(fw, name, obj, 4) != FWTS_OK)
                passed = false;

        ret = (nih_return_t *) obj->Buffer.Pointer;
ColinIanKing commented 10 months ago

This is not the official github repository, please re-do the issue report against https://github.com/fwts/