[PATCH] net: ethernet: mtk-star-emac: return ok when xmit drops
Bartosz Golaszewski
bgolaszewski at baylibre.com
Thu Nov 12 06:40:32 EST 2020
On Thu, Nov 12, 2020 at 12:35 PM Vincent Stehlé
<vincent.stehle at laposte.net> 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é <vincent.stehle at laposte.net>
> Cc: David S. Miller <davem at davemloft.net>
> Cc: Bartosz Golaszewski <bgolaszewski at baylibre.com>
> ---
> 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 <bgolaszewski at baylibre.com>
More information about the linux-arm-kernel
mailing list