Re: [PATCH net v4] ethernet: atl1: Add missing DMA mapping error checks
From: Simon Horman
Date: Tue Jun 24 2025 - 14:23:03 EST
On Mon, Jun 23, 2025 at 11:20:41AM +0200, Thomas Fourier wrote:
> The `dma_map_XXX()` functions can fail and must be checked using
> `dma_mapping_error()`. This patch adds proper error handling for all
> DMA mapping calls.
>
> In `atl1_alloc_rx_buffers()`, if DMA mapping fails, the buffer is
> deallocated and marked accordingly.
>
> In `atl1_tx_map()`, previously mapped buffers are unmapped and the
> packet is dropped on failure.
>
> Fixes: f3cc28c79760 ("Add Attansic L1 ethernet driver.")
> Signed-off-by: Thomas Fourier <fourier.thomas@xxxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>