File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
features/netsocket/emac-drivers/TARGET_NUVOTON_EMAC Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -222,15 +222,17 @@ bool NUMAKER_EMAC::link_out(emac_mem_buf_t *buf)
222222{
223223 bool result;
224224 emac_mem_buf_t *q;
225- uint8_t *buffer = numaker_eth_get_tx_buf () ;
225+ uint8_t *buffer = NULL ;
226226 uint32_t framelength = 0 ;
227227 uint32_t bufferoffset = 0 ;
228228 uint32_t byteslefttocopy = 0 ;
229229 uint32_t payloadoffset = 0 ;
230230
231231 /* Get exclusive access */
232232 TXLockMutex.lock ();
233+ buffer = numaker_eth_get_tx_buf ();
233234 NU_DEBUGF ((" %s ... buffer=0x%x\r\n " ,__FUNCTION__, buffer));
235+ if ( buffer == NULL ) goto error;
234236 /* copy frame from buf to driver buffers */
235237 for (q = buf; q != NULL ; q = memory_manager->get_next (q)) {
236238
You can’t perform that action at this time.
0 commit comments