@@ -372,9 +372,7 @@ ssize_t ib_uverbs_alloc_pd(struct ib_uverbs_file *file,
372
372
goto err_copy ;
373
373
}
374
374
375
- uobj_alloc_commit (uobj );
376
-
377
- return in_len ;
375
+ return uobj_alloc_commit (uobj , in_len );
378
376
379
377
err_copy :
380
378
ib_dealloc_pd (pd );
@@ -579,9 +577,7 @@ ssize_t ib_uverbs_open_xrcd(struct ib_uverbs_file *file,
579
577
580
578
mutex_unlock (& file -> device -> xrcd_tree_mutex );
581
579
582
- uobj_alloc_commit (& obj -> uobject );
583
-
584
- return in_len ;
580
+ return uobj_alloc_commit (& obj -> uobject , in_len );
585
581
586
582
err_copy :
587
583
if (inode ) {
@@ -723,9 +719,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
723
719
724
720
uobj_put_obj_read (pd );
725
721
726
- uobj_alloc_commit (uobj );
727
-
728
- return in_len ;
722
+ return uobj_alloc_commit (uobj , in_len );
729
723
730
724
err_copy :
731
725
ib_dereg_mr (mr );
@@ -901,9 +895,7 @@ ssize_t ib_uverbs_alloc_mw(struct ib_uverbs_file *file,
901
895
}
902
896
903
897
uobj_put_obj_read (pd );
904
- uobj_alloc_commit (uobj );
905
-
906
- return in_len ;
898
+ return uobj_alloc_commit (uobj , in_len );
907
899
908
900
err_copy :
909
901
uverbs_dealloc_mw (mw );
@@ -959,8 +951,7 @@ ssize_t ib_uverbs_create_comp_channel(struct ib_uverbs_file *file,
959
951
return - EFAULT ;
960
952
}
961
953
962
- uobj_alloc_commit (uobj );
963
- return in_len ;
954
+ return uobj_alloc_commit (uobj , in_len );
964
955
}
965
956
966
957
static struct ib_ucq_object * create_cq (struct ib_uverbs_file * file ,
@@ -1041,7 +1032,9 @@ static struct ib_ucq_object *create_cq(struct ib_uverbs_file *file,
1041
1032
if (ret )
1042
1033
goto err_cb ;
1043
1034
1044
- uobj_alloc_commit (& obj -> uobject );
1035
+ ret = uobj_alloc_commit (& obj -> uobject , 0 );
1036
+ if (ret )
1037
+ return ERR_PTR (ret );
1045
1038
return obj ;
1046
1039
1047
1040
err_cb :
@@ -1596,9 +1589,7 @@ static int create_qp(struct ib_uverbs_file *file,
1596
1589
if (ind_tbl )
1597
1590
uobj_put_obj_read (ind_tbl );
1598
1591
1599
- uobj_alloc_commit (& obj -> uevent .uobject );
1600
-
1601
- return 0 ;
1592
+ return uobj_alloc_commit (& obj -> uevent .uobject , 0 );
1602
1593
err_cb :
1603
1594
ib_destroy_qp (qp );
1604
1595
@@ -1801,10 +1792,7 @@ ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,
1801
1792
qp -> uobject = & obj -> uevent .uobject ;
1802
1793
uobj_put_read (xrcd_uobj );
1803
1794
1804
-
1805
- uobj_alloc_commit (& obj -> uevent .uobject );
1806
-
1807
- return in_len ;
1795
+ return uobj_alloc_commit (& obj -> uevent .uobject , in_len );
1808
1796
1809
1797
err_destroy :
1810
1798
ib_destroy_qp (qp );
@@ -2607,9 +2595,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
2607
2595
}
2608
2596
2609
2597
uobj_put_obj_read (pd );
2610
- uobj_alloc_commit (uobj );
2611
-
2612
- return in_len ;
2598
+ return uobj_alloc_commit (uobj , in_len );
2613
2599
2614
2600
err_copy :
2615
2601
rdma_destroy_ah (ah );
@@ -3155,8 +3141,7 @@ int ib_uverbs_ex_create_wq(struct ib_uverbs_file *file,
3155
3141
3156
3142
uobj_put_obj_read (pd );
3157
3143
uobj_put_obj_read (cq );
3158
- uobj_alloc_commit (& obj -> uevent .uobject );
3159
- return 0 ;
3144
+ return uobj_alloc_commit (& obj -> uevent .uobject , 0 );
3160
3145
3161
3146
err_copy :
3162
3147
ib_destroy_wq (wq );
@@ -3403,8 +3388,7 @@ int ib_uverbs_ex_create_rwq_ind_table(struct ib_uverbs_file *file,
3403
3388
for (j = 0 ; j < num_read_wqs ; j ++ )
3404
3389
uobj_put_obj_read (wqs [j ]);
3405
3390
3406
- uobj_alloc_commit (uobj );
3407
- return 0 ;
3391
+ return uobj_alloc_commit (uobj , 0 );
3408
3392
3409
3393
err_copy :
3410
3394
ib_destroy_rwq_ind_table (rwq_ind_tbl );
@@ -3605,11 +3589,10 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file,
3605
3589
goto err_copy ;
3606
3590
3607
3591
uobj_put_obj_read (qp );
3608
- uobj_alloc_commit (uobj );
3609
3592
kfree (flow_attr );
3610
3593
if (cmd .flow_attr .num_of_specs )
3611
3594
kfree (kern_flow_attr );
3612
- return 0 ;
3595
+ return uobj_alloc_commit ( uobj , 0 ) ;
3613
3596
err_copy :
3614
3597
if (!qp -> device -> destroy_flow (flow_id ))
3615
3598
atomic_dec (& qp -> usecnt );
@@ -3761,9 +3744,7 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
3761
3744
uobj_put_obj_read (attr .ext .cq );
3762
3745
3763
3746
uobj_put_obj_read (pd );
3764
- uobj_alloc_commit (& obj -> uevent .uobject );
3765
-
3766
- return 0 ;
3747
+ return uobj_alloc_commit (& obj -> uevent .uobject , 0 );
3767
3748
3768
3749
err_copy :
3769
3750
ib_destroy_srq (srq );
0 commit comments