diff options
author | stephen hemminger <stephen@networkplumber.org> | 2017-07-19 11:53:14 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-19 22:20:05 -0700 |
commit | a5e1ec3833211bc0136649a89ee3a29355c7b43b (patch) | |
tree | 352454bd448ffec43b108382eda37270529270bb /drivers | |
parent | 79e8cbe7a789a0863cc6cd874872b4dd63ec5947 (diff) | |
download | linux-a5e1ec3833211bc0136649a89ee3a29355c7b43b.tar.bz2 |
netvsc: change order of steps in setting queues
This fixes the error unwind logic for incorrect number of queues.
If netif_set_real_num_XX_queues failed then rndis_filter_device_add
would have been called twice. Since input arguments are already
ranged checked this is a hypothetical only problem, not possible
in actual code.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index e8e82a6a4b1a..91637336d1fb 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -724,17 +724,15 @@ static int netvsc_set_queues(struct net_device *net, struct hv_device *dev, device_info.ring_size = ring_size; device_info.max_num_vrss_chns = num_chn; - ret = rndis_filter_device_add(dev, &device_info); - if (ret) - return ret; - ret = netif_set_real_num_tx_queues(net, num_chn); if (ret) return ret; ret = netif_set_real_num_rx_queues(net, num_chn); + if (ret) + return ret; - return ret; + return rndis_filter_device_add(dev, &device_info); } static int netvsc_set_channels(struct net_device *net, |