mirror of https://github.com/ARMmbed/mbed-os.git
Added assert for malloc
parent
cab660d980
commit
65150b62b9
|
@ -218,10 +218,7 @@ emac_interface_t *wlan_emac_init_interface()
|
||||||
|
|
||||||
if (_emac == NULL) {
|
if (_emac == NULL) {
|
||||||
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t));
|
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t));
|
||||||
if (_emac == NULL) {//new emac_interface_t fail
|
MBED_ASSERT(_emac);
|
||||||
printf("emac initialization failed\r\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
_emac->hw = NULL;
|
_emac->hw = NULL;
|
||||||
memcpy((void*)&_emac->ops, &wlan_emac_interface, sizeof(wlan_emac_interface));
|
memcpy((void*)&_emac->ops, &wlan_emac_interface, sizeof(wlan_emac_interface));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue