mirror of https://github.com/ARMmbed/mbed-os.git
Added missing checks for wifi_link_out when allocating packets
parent
fd7c9cc13a
commit
32dfe73b09
|
@ -267,9 +267,16 @@ static bool wifi_link_out(emac_interface_t *emac, emac_stack_mem_t *buf)
|
||||||
(void)emac;
|
(void)emac;
|
||||||
// Break call chain to avoid the driver affecting stack usage for the IP stack thread too much
|
// Break call chain to avoid the driver affecting stack usage for the IP stack thread too much
|
||||||
emac_stack_mem_t *new_buf = emac_stack_mem_alloc(emac, emac_stack_mem_chain_len(emac,buf),0);
|
emac_stack_mem_t *new_buf = emac_stack_mem_alloc(emac, emac_stack_mem_chain_len(emac,buf),0);
|
||||||
emac_stack_mem_copy(emac,new_buf,buf);
|
if (new_buf != NULL) {
|
||||||
cbMAIN_getEventQueue()->call(send_packet,emac,new_buf);
|
emac_stack_mem_copy(emac, new_buf, buf);
|
||||||
cbMAIN_dispatchEventQueue();
|
int id = cbMAIN_getEventQueue()->call(send_packet, emac, new_buf);
|
||||||
|
if (id != 0) {
|
||||||
|
cbMAIN_dispatchEventQueue();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
emac_stack_mem_free(emac, new_buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue