diff options
| author | Dakshaja Uppalapati <[email protected]> | 2021-08-05 12:43:32 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2021-08-06 01:33:00 +0000 |
| commit | 2638a32348bbb1c384dbbd515fd2b12c155f0188 (patch) | |
| tree | 9fb7afbc32e8c6172a2cac36a79c88e51b5aefb1 /lib/debugobjects.c | |
| parent | RDMA/hns: Fix the double unlock problem of poll_sem (diff) | |
| download | kernel-2638a32348bbb1c384dbbd515fd2b12c155f0188.tar.gz kernel-2638a32348bbb1c384dbbd515fd2b12c155f0188.zip | |
RDMA/iw_cxgb4: Fix refcount underflow while destroying cqs.
Previous atomic increment/decrement logic expects the atomic count to be
'0' after the final decrement.
Replacing atomic count with refcount does not allow that, as
refcount_dec() considers count of 1 as underflow and triggers a kernel
splat.
Fix the current refcount logic by using the usual pattern of decrementing
the refcount and test if it is '0' on the final deref in
c4iw_destroy_cq(). Use wait_for_completion() instead of wait_event().
Fixes: 7183451f846d ("RDMA/cxgb4: Use refcount_t instead of atomic_t for reference counting")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dakshaja Uppalapati <[email protected]>
Reviewed-by: Potnuri Bharat Teja <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions
