diff options
| author | Wolfram Sang <wsa@kernel.org> | 2020-07-31 15:54:27 +0200 |
|---|---|---|
| committer | Wolfram Sang <wsa@kernel.org> | 2020-07-31 15:54:27 +0200 |
| commit | 073d398dc4841f62488ac6060ffeb9dfce6e0a98 (patch) | |
| tree | 2ae9d508d0cd27f02584b9befb063dda5cb11a0b /drivers/infiniband/core/rdma_core.c | |
| parent | afca861bc6a3141c858d08279eb9afca76584fa6 (diff) | |
| parent | 92ed301919932f777713b9172e525674157e983d (diff) | |
Merge tag 'v5.8-rc7' into i2c/for-5.9
Diffstat (limited to 'drivers/infiniband/core/rdma_core.c')
| -rw-r--r-- | drivers/infiniband/core/rdma_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c index 3027cd2fb247..6d3ed7c6e19e 100644 --- a/drivers/infiniband/core/rdma_core.c +++ b/drivers/infiniband/core/rdma_core.c @@ -649,9 +649,6 @@ void rdma_alloc_commit_uobject(struct ib_uobject *uobj, { struct ib_uverbs_file *ufile = attrs->ufile; - /* alloc_commit consumes the uobj kref */ - uobj->uapi_object->type_class->alloc_commit(uobj); - /* kref is held so long as the uobj is on the uobj list. */ uverbs_uobject_get(uobj); spin_lock_irq(&ufile->uobjects_lock); @@ -661,6 +658,9 @@ void rdma_alloc_commit_uobject(struct ib_uobject *uobj, /* matches atomic_set(-1) in alloc_uobj */ atomic_set(&uobj->usecnt, 0); + /* alloc_commit consumes the uobj kref */ + uobj->uapi_object->type_class->alloc_commit(uobj); + /* Matches the down_read in rdma_alloc_begin_uobject */ up_read(&ufile->hw_destroy_rwsem); } |