File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
targets/TARGET_Realtek/TARGET_AMEBA Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,14 @@ RTWInterface::RTWInterface()
93
93
94
94
emac = wlan_emac_init_interface ();
95
95
if (!emac) {
96
- printf (" Error init RTWInterface!\r\n " );
96
+ printf (" Error init RTWInterface!\r\n " );
97
+ return ;
97
98
}
98
99
emac->ops .power_up (emac);
99
100
ret = mbed_lwip_init (emac);
100
101
if (ret != 0 ) {
101
102
printf (" Error init RTWInterface!(%d)\r\n " , ret);
103
+ return ;
102
104
}
103
105
}
104
106
Original file line number Diff line number Diff line change @@ -218,6 +218,10 @@ emac_interface_t *wlan_emac_init_interface()
218
218
219
219
if (_emac == NULL ) {
220
220
_emac = new emac_interface_t ();
221
+ if (_emac == NULL ) {// new emac_interface_t fail
222
+ printf (" emac initialization failed\r\n " );
223
+ return NULL ;
224
+ }
221
225
_emac->hw = NULL ;
222
226
memcpy ((void *)&_emac->ops , &wlan_emac_interface, sizeof (wlan_emac_interface));
223
227
}
You can’t perform that action at this time.
0 commit comments