Ver Fonte

hv_netvsc: Fix the channel limit in netvsc_set_rxfh()

The limit of setting receive indirection table value should be
the current number of channels, not the VRSS_CHANNEL_MAX.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Haiyang Zhang há 8 anos atrás
pai
commit
db3cd7af9d
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      drivers/net/hyperv/netvsc_drv.c

+ 1 - 1
drivers/net/hyperv/netvsc_drv.c

@@ -1407,7 +1407,7 @@ static int netvsc_set_rxfh(struct net_device *dev, const u32 *indir,
 	rndis_dev = ndev->extension;
 	if (indir) {
 		for (i = 0; i < ITAB_NUM; i++)
-			if (indir[i] >= VRSS_CHANNEL_MAX)
+			if (indir[i] >= ndev->num_chn)
 				return -EINVAL;
 
 		for (i = 0; i < ITAB_NUM; i++)