diff options
author | David S. Miller <davem@davemloft.net> | 2019-03-02 21:54:35 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-02 21:54:35 +0100 |
commit | 9eb359140cd307f8a14f61c19b155ffca5291057 (patch) | |
tree | 22d5143608ef1744ca4b7025414777defe8bcca5 /drivers/net/xen-netback/interface.c | |
parent | Merge tag 'wireless-drivers-next-for-davem-2019-03-01' of git://git.kernel.or... (diff) | |
parent | net: sit: fix memory leak in sit_init_net() (diff) | |
download | linux-9eb359140cd307f8a14f61c19b155ffca5291057.tar.xz linux-9eb359140cd307f8a14f61c19b155ffca5291057.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r-- | drivers/net/xen-netback/interface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 182d6770f102..6da12518e693 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -153,6 +153,13 @@ static u16 xenvif_select_queue(struct net_device *dev, struct sk_buff *skb, { struct xenvif *vif = netdev_priv(dev); unsigned int size = vif->hash.size; + unsigned int num_queues; + + /* If queues are not set up internally - always return 0 + * as the packet going to be dropped anyway */ + num_queues = READ_ONCE(vif->num_queues); + if (num_queues < 1) + return 0; if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE) return fallback(dev, skb, NULL) % dev->real_num_tx_queues; |