vbox: don't fault if NIC is unavailable

This patch prevents vbox from faulting in the (unexpected) case where
the VM has a network adaptor configured but the NIC session cannot be
opened.
This commit is contained in:
Norman Feske 2015-11-11 10:12:43 +01:00 committed by Christian Helmuth
parent 853378960c
commit f655ac31f7
1 changed files with 8 additions and 2 deletions

View File

@ -452,11 +452,17 @@ static DECLCALLBACK(void) drvNicDestruct(PPDMDRVINS pDrvIns)
PDRVNIC pThis = PDMINS_2_DATA(pDrvIns, PDRVNIC);
Nic_client *nic_client = pThis->nic_client;
Genode::Signal_transmitter(nic_client->dispatcher()).submit();
if (!nic_client)
PERR("nic_client not valid at destruction time");
if (nic_client)
Genode::Signal_transmitter(nic_client->dispatcher()).submit();
/* wait until the recv thread exits */
destruct_lock()->lock();
destroy(Genode::env()->heap(), nic_client);
if (nic_client)
destroy(Genode::env()->heap(), nic_client);
}