lwIP | Add GRETH/GRETH_GBIT driver (!40)
Kinsey Moore (@opticron)
gitlab at rtems.org
Mon Jun 15 22:28:57 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_152379
> + * @param netif Pointer to the lwIP network interface structure associated with
> + * this GRETH device.
> + *
> + * @retval ERR_OK Initialization completed successfully.
> + * @retval ERR_IF Driver attach failed, @ref greth_netif_state allocation
> + * failed, or GRETH device already initialized.
> + * @retval other Error code returned by low-level GRETH initialization
> + * functions (e.g., @ref greth_init_hw(),
> + * @ref greth_init_control_structures(),
> + * @ref greth_install_interrupt_handlers()).
> + */
> +err_t greth_init_dev_and_lwip_netif( struct netif *netif )
> +{
> + err_t ret;
> + struct greth_netif_state *nf_state;
> + struct lwip_greth_hw_cfg *hw_cfg = netif->state;
A `struct greth_netif_state` is passed to netif_add, but this casts it to a `struct lwip_greth_hw_cfg` and later in this function the state parameter is overwritten with a pointer to `struct greth_netif_state` and the original is never freed (and there's no guarantee that it *can* be freed).
--
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-lwip/-/merge_requests/40#note_152379
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/6eea36ac/attachment-0001.htm>
More information about the bugs
mailing list