]> xenbits.xensource.com Git - people/andrewcoop/qemu-traditional.git/commitdiff
smbios: Don't allocate smbus eeprom buffer
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 21 Apr 2015 13:32:08 +0000 (14:32 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Oct 2015 15:52:06 +0000 (16:52 +0100)
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 <andrew.cooper3@citrix.com>
Coverity-ID: 1090387

hw/pc.c

diff --git a/hw/pc.c b/hw/pc.c
index 3e336946d8df0e8ba4cfae36cfe6c08d5d82c437..7359338194ac5c52bdf813d0c1512039046aee62 100644 (file)
--- 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) {