Fix the preliminary check of HP type 203 records:
* If generation is too old, return 0 so that the raw record will be
  displayed.
* If length is too short, still print the record type header.
This is how all other records are handled.

Also drop the duplicate company name in the header.

Signed-off-by: Jean Delvare <jdelv...@suse.de>
Cc: Jerry Hoemann <jerry.hoem...@hpe.com>
---
 dmioem.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmioem.c     2022-05-24 13:46:59.441912644 +0200
+++ dmidecode/dmioem.c  2022-05-24 13:54:14.576638729 +0200
@@ -380,9 +380,9 @@ static int dmi_decode_hp(const struct dm
                         *  0x26  | Bus Number   | BYTE  | PCI Device Bus Number
                         *  0x27  | Func Number  | BTYE  | PCI Device and 
Function Number
                         */
-                       if (gen < G9) break;
+                       if (gen < G9) return 0;
+                       pr_handle_name("%s Device Correlation Record", company);
                        if (h->length < 0x1F) break;
-                       pr_handle_name("%s HP Device Correlation Record", 
company);
                        dmi_hp_203_assoc_hndl("Associated Device Record", 
WORD(data + 0x04));
                        dmi_hp_203_assoc_hndl("Associated SMBus Record",  
WORD(data + 0x06));
                        if (WORD(data + 0x08) == 0xffff && WORD(data + 0x0A) == 
0xffff &&


-- 
Jean Delvare
SUSE L3 Support

_______________________________________________
https://lists.nongnu.org/mailman/listinfo/dmidecode-devel

Reply via email to