Skip to content

Commit e4ff3d2

Browse files
Artemy-Mellanoxjgunthorpe
authored andcommitted
IB/core: Release object lock if destroy failed
The object lock was supposed to always be released during destroy, but when the destruction retry series was integrated with the destroy series it created a failure path that missed the unlock. Keep with convention, if destroy fails the caller must undo all locking. Fixes: 87ad80a ("IB/uverbs: Consolidate uobject destruction") Signed-off-by: Artemy Kovalyov <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 0d23ba6 commit e4ff3d2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/infiniband/core/rdma_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ static int __uverbs_cleanup_ufile(struct ib_uverbs_file *ufile,
882882
WARN_ON(uverbs_try_lock_object(obj, UVERBS_LOOKUP_WRITE));
883883
if (!uverbs_destroy_uobject(obj, reason))
884884
ret = 0;
885+
else
886+
atomic_set(&obj->usecnt, 0);
885887
}
886888
return ret;
887889
}

0 commit comments

Comments
 (0)