mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-25 00:14:00 +00:00
flashrom: Only set the BIOS size if not already quirked
This commit is contained in:
parent
5ac8594d92
commit
c0bdb8dd7a
@ -113,7 +113,6 @@ fu_plugin_flashrom_device_set_bios_info(FuPlugin *plugin, FuDevice *device)
|
||||
const guint8 *buf;
|
||||
gsize bufsz;
|
||||
guint32 bios_char = 0x0;
|
||||
guint8 bios_sz = 0x0;
|
||||
g_autoptr(GBytes) bios_table = NULL;
|
||||
|
||||
/* get SMBIOS info */
|
||||
@ -121,11 +120,14 @@ fu_plugin_flashrom_device_set_bios_info(FuPlugin *plugin, FuDevice *device)
|
||||
if (bios_table == NULL)
|
||||
return;
|
||||
|
||||
/* ROM size */
|
||||
/* ROM size if not already been quirked */
|
||||
buf = g_bytes_get_data(bios_table, &bufsz);
|
||||
if (fu_common_read_uint8_safe(buf, bufsz, 0x9, &bios_sz, NULL)) {
|
||||
guint64 firmware_size = (bios_sz + 1) * 64 * 1024;
|
||||
fu_device_set_firmware_size_max(device, firmware_size);
|
||||
if (fu_device_get_firmware_size_max(device) == 0) {
|
||||
guint8 bios_sz = 0x0;
|
||||
if (fu_common_read_uint8_safe(buf, bufsz, 0x9, &bios_sz, NULL)) {
|
||||
guint64 firmware_size = (bios_sz + 1) * 64 * 1024;
|
||||
fu_device_set_firmware_size_max(device, firmware_size);
|
||||
}
|
||||
}
|
||||
|
||||
/* BIOS characteristics */
|
||||
|
Loading…
Reference in New Issue
Block a user