summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2017-09-02 00:30:07 +0300
committerDavid S. Miller <davem@davemloft.net>2017-09-02 06:39:12 +0300
commitdb3cd7af9d0f174475cbcc02c0e96a5408fe2dc2 (patch)
treefa525e286dd48dcbeab6407a1c39aaa5dad6cc5a /drivers/net
parent06be580ac7b650938cb3f2cf8cd02d73ff96d3e4 (diff)
downloadlinux-db3cd7af9d0f174475cbcc02c0e96a5408fe2dc2.tar.xz
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index fd65d32bf24d..165ba4b3b423 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/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++)