summaryrefslogtreecommitdiff
path: root/hw/dp8393x.c
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-07-01 16:46:38 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-09 16:58:07 -0500
commitc7d31bd194c65076c41db3812d47e07789011ac8 (patch)
tree836a0fb70b51d1ca20f11afcae2a91f5c5ca637d /hw/dp8393x.c
parent009459333db34ccdf8b85136a47a19ca49d7ee00 (diff)
downloadqemu-c7d31bd194c65076c41db3812d47e07789011ac8.tar.gz
qemu-c7d31bd194c65076c41db3812d47e07789011ac8.tar.bz2
qemu-c7d31bd194c65076c41db3812d47e07789011ac8.zip
Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer, but then goes on to require that the same pointer matches VLANClientState::opaque. That is no longer the case for virtio-net since qdev and wasn't previously the case for rtl8139, ne2k_pci or eepro100. Make the situation a lot more clear by maintaining a VLANClientState pointer in NICInfo. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/dp8393x.c')
-rw-r--r--hw/dp8393x.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/dp8393x.c b/hw/dp8393x.c
index 1a271954d5..e2f86b81d8 100644
--- a/hw/dp8393x.c
+++ b/hw/dp8393x.c
@@ -890,8 +890,9 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
s->watchdog = qemu_new_timer(vm_clock, dp8393x_watchdog, s);
s->regs[SONIC_SR] = 0x0004; /* only revision recognized by Linux */
- s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, nic_can_receive,
- nic_receive, NULL, nic_cleanup, s);
+ s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
+ nic_can_receive, nic_receive, NULL,
+ nic_cleanup, s);
qemu_format_nic_info_str(s->vc, nd->macaddr);
qemu_register_reset(nic_reset, s);