On Thu, Nov 12, 2020 at 12:35 PM Vincent Stehlé
<[email protected]> wrote:
>
> The ndo_start_xmit() method must return NETDEV_TX_OK if the DMA mapping
> fails, after freeing the socket buffer.
> Fix the mtk_star_netdev_start_xmit() function accordingly.
>
> Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver")
> Signed-off-by: Vincent Stehlé <[email protected]>
> Cc: David S. Miller <[email protected]>
> Cc: Bartosz Golaszewski <[email protected]>
> ---
> drivers/net/ethernet/mediatek/mtk_star_emac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c
> index 13250553263b5..e56a26f797f28 100644
> --- a/drivers/net/ethernet/mediatek/mtk_star_emac.c
> +++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c
> @@ -1053,7 +1053,7 @@ static int mtk_star_netdev_start_xmit(struct sk_buff *skb,
> err_drop_packet:
> dev_kfree_skb(skb);
> ndev->stats.tx_dropped++;
> - return NETDEV_TX_BUSY;
> + return NETDEV_TX_OK;
> }
>
> /* Returns the number of bytes sent or a negative number on the first
> --
> 2.28.0
>
Good catch, thanks!
Acked-by: Bartosz Golaszewski <[email protected]>