File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
drivers/infiniband/hw/mlx5 Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -546,6 +546,7 @@ static int mlx5_ib_counter_bind_qp(struct rdma_counter *counter,
546
546
struct ib_qp * qp )
547
547
{
548
548
struct mlx5_ib_dev * dev = to_mdev (qp -> device );
549
+ bool new = false;
549
550
int err ;
550
551
551
552
if (!counter -> id ) {
@@ -560,6 +561,7 @@ static int mlx5_ib_counter_bind_qp(struct rdma_counter *counter,
560
561
return err ;
561
562
counter -> id =
562
563
MLX5_GET (alloc_q_counter_out , out , counter_set_id );
564
+ new = true;
563
565
}
564
566
565
567
err = mlx5_ib_qp_set_counter (qp , counter );
@@ -569,8 +571,10 @@ static int mlx5_ib_counter_bind_qp(struct rdma_counter *counter,
569
571
return 0 ;
570
572
571
573
fail_set_counter :
572
- mlx5_ib_counter_dealloc (counter );
573
- counter -> id = 0 ;
574
+ if (new ) {
575
+ mlx5_ib_counter_dealloc (counter );
576
+ counter -> id = 0 ;
577
+ }
574
578
575
579
return err ;
576
580
}
You can’t perform that action at this time.
0 commit comments