Bläddra i källkod

[smbios] Default to "hex" type for non-string SMBIOS settings

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 år sedan
förälder
incheckning
c4500fb7ca
1 ändrade filer med 10 tillägg och 3 borttagningar
  1. 10
    3
      src/interface/smbios/smbios_settings.c

+ 10
- 3
src/interface/smbios/smbios_settings.c Visa fil

@@ -120,14 +120,21 @@ static int smbios_fetch ( struct settings *settings __unused,
120 120
 
121 121
 		if ( tag_len == 0 ) {
122 122
 			/* String */
123
-			return read_smbios_string ( &structure,
124
-						    buf[tag_offset],
125
-						    data, len );
123
+			if ( ( rc = read_smbios_string ( &structure,
124
+							 buf[tag_offset],
125
+							 data, len ) ) < 0 ) {
126
+				return rc;
127
+			}
128
+			if ( ! setting->type )
129
+				setting->type = &setting_type_string;
130
+			return rc;
126 131
 		} else {
127 132
 			/* Raw data */
128 133
 			if ( len > tag_len )
129 134
 				len = tag_len;
130 135
 			memcpy ( data, &buf[tag_offset], len );
136
+			if ( ! setting->type )
137
+				setting->type = &setting_type_hex;
131 138
 			return tag_len;
132 139
 		}
133 140
 	}

Laddar…
Avbryt
Spara