diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/onenand.c | 4 | ||||
-rw-r--r-- | hw/ide/piix.c | 2 | ||||
-rw-r--r-- | hw/usb/dev-storage.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/hw/block/onenand.c b/hw/block/onenand.c index 60d5311d04..5388122eb8 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -335,9 +335,7 @@ static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn, dp, 1) < 0; } } - if (dp) { - g_free(dp); - } + g_free(dp); } return result; } diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 40757eb001..8651726f52 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -184,7 +184,7 @@ int pci_piix3_xen_ide_unplug(DeviceState *dev) } bdrv_close(di->bdrv); pci_ide->bus[di->bus].ifs[di->unit].bs = NULL; - drive_put_ref(di); + drive_del(di); } } qdev_reset_all(DEVICE(dev)); diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index e919100637..ae4efcbd2d 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -691,7 +691,7 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename) qemu_opt_set(opts, "if", "none"); /* create host drive */ - dinfo = drive_init(opts, 0); + dinfo = drive_new(opts, 0); if (!dinfo) { qemu_opts_del(opts); return NULL; |