]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
nfp: validate the return code from dev_queue_xmit()
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 27 Mar 2019 18:38:38 +0000 (11:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Mar 2019 00:04:29 +0000 (17:04 -0700)
dev_queue_xmit() may return error codes as well as netdev_tx_t,
and it always consumes the skb.  Make sure we always return a
correct netdev_tx_t value.

Fixes: eadfa4c3be99 ("nfp: add stats and xmit helpers for representors")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c

index d2c803bb4e562dd3805aaea86e689e5f682ce9ed..7b46fce2e81e0f09331ee10a679c70bbbe8a1064 100644 (file)
@@ -195,7 +195,7 @@ static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev)
        ret = dev_queue_xmit(skb);
        nfp_repr_inc_tx_stats(netdev, len, ret);
 
-       return ret;
+       return NETDEV_TX_OK;
 }
 
 static int nfp_repr_stop(struct net_device *netdev)