aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-01-19 10:55:19 -0400
committerJason Gunthorpe <jgg@nvidia.com>2021-01-19 10:55:19 -0400
commit02487bcc84cdec676b667096f896ba8ad254aae9 (patch)
treedf66e03b2c63f3488326357882f84b16ed532e1b /drivers/net/virtio_net.c
parentIB/isert: Simplify signature cap check (diff)
parentRDMA/mlx5: Use strict get/set operations for obj_id (diff)
downloadlinux-dev-02487bcc84cdec676b667096f896ba8ad254aae9.tar.xz
linux-dev-02487bcc84cdec676b667096f896ba8ad254aae9.zip
Merge branch 'devx_set_get' into rdma.git for-next
Leon Romanovsky says: ==================== Be more strict with DEVX get/set operations for the obj_id. ==================== Based on the mlx5-next branch at git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux due to dependencies. * branch 'devx_set_get': RDMA/mlx5: Use strict get/set operations for obj_id RDMA/mlx5: Use the correct obj_id upon DEVX TIR creation net/mlx5: Expose ifc bits for query modify header
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4c41df624dbb..508408fbe78f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2093,14 +2093,16 @@ static int virtnet_set_channels(struct net_device *dev,
get_online_cpus();
err = _virtnet_set_queues(vi, queue_pairs);
- if (!err) {
- netif_set_real_num_tx_queues(dev, queue_pairs);
- netif_set_real_num_rx_queues(dev, queue_pairs);
-
- virtnet_set_affinity(vi);
+ if (err) {
+ put_online_cpus();
+ goto err;
}
+ virtnet_set_affinity(vi);
put_online_cpus();
+ netif_set_real_num_tx_queues(dev, queue_pairs);
+ netif_set_real_num_rx_queues(dev, queue_pairs);
+ err:
return err;
}