Unverified Commit 34f386a2 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

LwIpIntfDev.end() check _started to prevent crash (#2304)

From @JAndrassy https://github.com/esp8266/Arduino/pull/9173
parent dd1c9095
......@@ -427,18 +427,20 @@ bool LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu) {
template<class RawDev>
void LwipIntfDev<RawDev>::end() {
if (_intrPin < 0) {
__removeEthernetPacketHandler(_phID);
} else {
detachInterrupt(_intrPin);
__removeEthernetGPIO(_intrPin);
}
if (_started) {
if (_intrPin < 0) {
__removeEthernetPacketHandler(_phID);
} else {
detachInterrupt(_intrPin);
__removeEthernetGPIO(_intrPin);
}
RawDev::end();
RawDev::end();
netif_remove(&_netif);
netif_remove(&_netif);
_started = false;
_started = false;
}
}
template<class RawDev>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment