Skip to content
Snippets Groups Projects
Commit d68f0f77 authored by Li Qiang's avatar Li Qiang Committed by John Snow
Browse files

ide: ahci: call cleanup function in ahci unit


This can avoid memory leak when hotunplug the ahci device.

Signed-off-by: default avatarLi Qiang <liqiang6-s@360.cn>
Message-id: 1488449293-80280-4-git-send-email-liqiang6-s@360.cn
Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
parent c9f08641
No related branches found
No related tags found
No related merge requests found
......@@ -1485,6 +1485,18 @@ void ahci_realize(AHCIState *s, DeviceState *qdev, AddressSpace *as, 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 < 2; j++) {
IDEState *s = &ad->port.ifs[j];
ide_exit(s);
}
}
g_free(s->dev);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment