Re: [PATCH net v2] net: dlink: handle dma_map_single() failure properly

From: Simon Horman
Date: Fri Oct 10 2025 - 02:55:35 EST


On Fri, Oct 10, 2025 at 12:57:16AM +0900, Yeounsu Moon wrote:
> There is no error handling for `dma_map_single()` failures.
>
> Add error handling by checking `dma_mapping_error()` and freeing
> the `skb` using `dev_kfree_skb()` (process context) when it fails.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Yeounsu Moon <yyyynoom@xxxxxxxxx>
> Tested-on: D-Link DGE-550T Rev-A3
> Suggested-by: Simon Horman <horms@xxxxxxxxxx>

FWIIW, I don't think my Suggested-by tag is strictly necessary here. I did
suggest an implementation approach. And I'm very happy that you took my
idea on board. But I'd view as more of a tweak in this case. Because the
overall meaning of the patch remains the same as your original version.

> ---
> Changelog:
> v2:
> - fix one thing properly
> - use goto statement, per Simon's suggestion
> v1: https://lore.kernel.org/netdev/20251002152638.1165-1-yyyynoom@xxxxxxxxx/

Thanks for the update, this version looks good to me.

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>