Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.12301
0265-ide-core-add-cleanup-function.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0265-ide-core-add-cleanup-function.patch of Package qemu.12301
From 0148243538774081d8bac620c7353ee233fd5893 Mon Sep 17 00:00:00 2001 From: Li Qiang <liq3ea@gmail.com> Date: Wed, 15 Mar 2017 20:50:14 -0400 Subject: [PATCH] ide: core: add cleanup function As the pci ahci can be hotplug and unplug, in the ahci unrealize function it should free all the resource once allocated in the realized function. This patch add ide_exit to free the resource. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Message-id: 1488449293-80280-3-git-send-email-liqiang6-s@360.cn Signed-off-by: John Snow <jsnow@redhat.com> (cherry picked from commit c9f086418a255f386e1c4d2c1418c032eb349537) [BSC#1042801 CVE-2017-9373] Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/ide/core.c | 8 ++++++++ hw/ide/internal.h | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index 90e103f49b..76a4a5c322 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2458,6 +2458,14 @@ void ide_init2(IDEBus *bus, qemu_irq irq) bus->dma = &ide_dma_nop; } +void ide_exit(IDEState *s) +{ + timer_del(s->sector_write_timer); + timer_free(s->sector_write_timer); + qemu_vfree(s->smart_selftest_data); + qemu_vfree(s->io_buffer); +} + static const MemoryRegionPortio ide_portio_list[] = { { 0, 8, 1, .read = ide_ioport_read, .write = ide_ioport_write }, { 0, 2, 2, .read = ide_data_readw, .write = ide_data_writew }, diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 965cc55cb8..35ba68786a 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -556,6 +556,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind, uint32_t cylinders, uint32_t heads, uint32_t secs, int chs_trans); void ide_init2(IDEBus *bus, qemu_irq irq); +void ide_exit(IDEState *s); void ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); void ide_register_restart_cb(IDEBus *bus);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor