lwIP | Add GRETH/GRETH_GBIT driver (!40)

Kinsey Moore (@opticron) gitlab at rtems.org
Mon Jun 15 22:29:07 UTC 2026




Kinsey Moore started a new discussion on rtemslwip/greth/greth_netif.c: https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/40#note_152381

 > +  if ( !rxch->rx_pbuf_ref ) {
 > +    greth_debug_printf(
 > +      "[ERR] greth_init_buffer_descriptors: Failed to allocate memory "
 > +      "for RX pbuf references\n"
 > +    );
 > +    goto free_rx_pbuf;
 > +  }
 > +
 > +  txch->desc_array = (struct greth_bd *)
 > +    aligned_alloc( bd_table_size, bd_table_size );
 > +  if ( !txch->desc_array ) {
 > +    greth_debug_printf(
 > +      "[ERR] greth_init_buffer_descriptors: Failed to allocate memory "
 > +      "for TX descriptors\n"
 > +    );
 > +    goto free_tx_desc;

We should avoid gotos. This can instead free known allocations or it can initialize to NULL and pass all things that might need to be freed to a helper function that checks for and frees anything that as allocated.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/40#note_152381
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260615/8a00ec82/attachment.htm>


More information about the bugs mailing list