Added assert for malloc

pull/5069/head
Deepika 2017-09-11 11:31:22 -05:00
parent cab660d980
commit 65150b62b9
1 changed files with 1 additions and 4 deletions

View File

@ -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));
} }