gve: Correct SKB queue index validation.
authorDavid Awogbemila <awogbemila@google.com>
Mon, 17 May 2021 21:08:15 +0000 (14:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 May 2021 22:38:40 +0000 (15:38 -0700)
SKBs with skb_get_queue_mapping(skb) == tx_cfg.num_queues should also be
considered invalid.

Fixes: f5cedc84a30d ("gve: Add transmit and receive support")
Signed-off-by: David Awogbemila <awogbemila@google.com>
Acked-by: Willem de Brujin <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/google/gve/gve_tx.c

index bb57c42872b48887f88c3d8fd26e753bebe0c887..3e04a3973d6803bbe4ed6068bbcac76219d017f3 100644 (file)
@@ -593,7 +593,7 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev)
        struct gve_tx_ring *tx;
        int nsegs;
 
-       WARN(skb_get_queue_mapping(skb) > priv->tx_cfg.num_queues,
+       WARN(skb_get_queue_mapping(skb) >= priv->tx_cfg.num_queues,
             "skb queue index out of range");
        tx = &priv->tx[skb_get_queue_mapping(skb)];
        if (unlikely(gve_maybe_stop_tx(tx, skb))) {