net: ethernet: mtk-star-emac: return ok when xmit drops
authorVincent Stehlé <vincent.stehle@laposte.net>
Thu, 12 Nov 2020 08:48:33 +0000 (09:48 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Nov 2020 01:05:15 +0000 (17:05 -0800)
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@laposte.net>
Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20201112084833.21842-1-vincent.stehle@laposte.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mediatek/mtk_star_emac.c

index 1325055..e56a26f 100644 (file)
@@ -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