dinetwork: avoid crashing (nw)

This commit is contained in:
Patrick Mackinlay 2018-11-20 12:35:08 +07:00
parent 0e9a05ce24
commit c2ffeb4ad6

View file

@ -53,6 +53,7 @@ void device_network_interface::recv_cb(u8 *buf, int len)
if (result) if (result)
{ {
// stop receiving more data from the network // stop receiving more data from the network
if (m_dev)
m_dev->stop(); m_dev->stop();
// schedule receive complete callback // schedule receive complete callback
@ -65,6 +66,7 @@ TIMER_CALLBACK_MEMBER(device_network_interface::recv_complete)
recv_complete_cb(param); recv_complete_cb(param);
// start receiving data from the network again // start receiving data from the network again
if (m_dev)
m_dev->start(); m_dev->start();
} }