RE: [PATCH net 1/8] net: enetc: fix the off-by-one issue in enetc_map_tx_buffs()
From: Claudiu Manoil
Date: Tue Feb 18 2025 - 05:19:39 EST
> -----Original Message-----
> From: Wei Fang <wei.fang@xxxxxxx>
> Sent: Tuesday, February 18, 2025 11:18 AM
[...]
> > enetc_free_tx_frame() call on dma_err path is still needed for count 0
> > because it needs to free the skb.
>
> First, the tx_swbd is not set when count is 0, so tx_swbd->skb is NULL when
> the error occurs.
>
> Second, the skb is freed in enetc_start_xmit() not enetc_free_tx_frame().
Yeah, noticed too finally.
'do {} while()' is not ok on error path here.