[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/8] ahci: free dynamically allocated iovs
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 7/8] ahci: free dynamically allocated iovs |
Date: |
Mon, 20 Dec 2010 22:13:23 +0100 |
We allocate iovs on the fly now, but also need to free them on uninit.
This patch does that.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ide/ahci.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index c0bc5ff..97aef68 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1207,6 +1207,16 @@ void ahci_init(AHCIState *s, DeviceState *qdev, int
ports)
void ahci_uninit(AHCIState *s)
{
+ int i, j;
+
+ for (i = 0; i < s->ports; i++) {
+ AHCIDevice *ad = &s->dev[i];
+ for (j = 0; j < AHCI_MAX_CMDS; j++) {
+ if (ad->ncq_tfs[j].iov_max) {
+ qemu_free(ad->ncq_tfs[j].iov);
+ }
+ }
+ }
qemu_free(s->dev);
}
--
1.6.0.2
- [Qemu-devel] [PATCH 0/8] Some more AHCI work, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 8/8] ahci: fix !msi interrupts, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 3/8] ahci: send init d2h fis on fis enable, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 6/8] ahci: make number of ports runtime determined, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 5/8] ahci: Implement HBA reset, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 7/8] ahci: free dynamically allocated iovs,
Alexander Graf <=
- [Qemu-devel] [PATCH 2/8] ahci: split ICH and AHCI even more, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 4/8] ahci: use qiov instead of dma helpers, Alexander Graf, 2010/12/20
- [Qemu-devel] [PATCH 1/8] ahci: split ICH9 from core, Alexander Graf, 2010/12/20