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<[email protected]> Acked-by: Jason Wang <[email protected]> Signed-off-by: Eli Cohen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 612f330 commit 37e07e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)