Skip to content

Commit 37e07e7

Browse files
elic307imstsirkin
authored andcommitted
vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps()
Restore ndev->cur_num_vqs to the original value in case change_num_qps() fails. Fixes: 5289373 ("vdpa/mlx5: Add multiqueue support") Reviewed-by: Si-Wei Liu<si-wei.liu@oracle.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20220105114646.577224-10-elic@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 612f330 commit 37e07e7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,9 +1541,11 @@ static int change_num_qps(struct mlx5_vdpa_dev *mvdev, int newqps)
15411541
return 0;
15421542

15431543
clean_added:
1544-
for (--i; i >= cur_qps; --i)
1544+
for (--i; i >= 2 * cur_qps; --i)
15451545
teardown_vq(ndev, &ndev->vqs[i]);
15461546

1547+
ndev->cur_num_vqs = 2 * cur_qps;
1548+
15471549
return err;
15481550
}
15491551

0 commit comments

Comments
 (0)