Message ID | 1292879604-22268-8-git-send-email-agraf@suse.de |
---|---|
State | New |
Headers | show |
Am 20.12.2010 22:13, schrieb Alexander Graf: > We allocate iovs on the fly now, but also need to free them on uninit. > This patch does that. > > Signed-off-by: Alexander Graf <agraf@suse.de> Isn't this a fix for patch 4? If so, please merge it there. Kevin
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); }
We allocate iovs on the fly now, but also need to free them on uninit. This patch does that. Signed-off-by: Alexander Graf <agraf@suse.de> --- hw/ide/ahci.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)