Commit 81da1314 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Greg Kroah-Hartman

nfp: validate the return code from dev_queue_xmit()

[ Upstream commit c8ba5b91 ]

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: eadfa4c3 ("nfp: add stats and xmit helpers for representors")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarJohn Hurley <john.hurley@netronome.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c297e881
...@@ -225,7 +225,7 @@ static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -225,7 +225,7 @@ static netdev_tx_t nfp_repr_xmit(struct sk_buff *skb, struct net_device *netdev)
ret = dev_queue_xmit(skb); ret = dev_queue_xmit(skb);
nfp_repr_inc_tx_stats(netdev, len, ret); nfp_repr_inc_tx_stats(netdev, len, ret);
return ret; return NETDEV_TX_OK;
} }
static int nfp_repr_stop(struct net_device *netdev) static int nfp_repr_stop(struct net_device *netdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment