From: Andrew Cooper Date: Tue, 21 Apr 2015 13:32:08 +0000 (+0100) Subject: smbios: Don't allocate smbus eeprom buffer X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b1f89c26126df966894b1e0746bfa56267ae1478;p=qemu-xen-4.6-testing.git smbios: Don't allocate smbus eeprom buffer smbus_eeprom_device_init() has been disabled since 2007. The #define turns the actual function call into a comma expression with no effect. Removing the leaked allocation also makes Valgrind happier. Signed-off-by: Andrew Cooper Coverity-ID: 1090387 --- diff --git a/hw/pc.c b/hw/pc.c index 3e336946d..735933819 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -79,7 +79,6 @@ static void xen_relocator_hook(target_phys_addr_t *prot_addr_upd, uint16_t protocol, const uint8_t header[], int kernel_size, target_phys_addr_t real_addr, int real_size); -#define smbus_eeprom_device_init (void) static void ioport80_write(void *opaque, uint32_t addr, uint32_t data) { @@ -1135,17 +1134,8 @@ vga_bios_error: } if (pci_enabled && acpi_enabled) { - uint8_t *eeprom_buf = qemu_mallocz(8 * 256); /* XXX: make this persistent */ - i2c_bus *smbus; - /* TODO: Populate SPD eeprom data. */ - smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]); - - if (smbus) { - for (i = 0; i < 8; i++) { - smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256)); - } - } + piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]); } if (i440fx_state) {