|
@@ -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
|
}
|