diff options
author | Weihang Li <liweihang@huawei.com> | 2021-05-28 17:37:42 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-08 14:59:05 -0300 |
commit | 7183451f846d22e9fee665756824c9c2cc9cf377 (patch) | |
tree | ebdabf1e7e40feea0d8f5fafb61efc5b629e5fbd /drivers/infiniband/hw/cxgb4/iw_cxgb4.h | |
parent | RDMA/hns: Use refcount_t instead of atomic_t for QP reference counting (diff) | |
download | linux-dev-7183451f846d22e9fee665756824c9c2cc9cf377.tar.xz linux-dev-7183451f846d22e9fee665756824c9c2cc9cf377.zip |
RDMA/cxgb4: Use refcount_t instead of atomic_t for reference counting
The refcount_t API will WARN on underflow and overflow of a reference
counter, and avoid use-after-free risks.
Link: https://lore.kernel.org/r/1622194663-2383-12-git-send-email-liweihang@huawei.com
Cc: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h index cdec5deb37a1..3883af3d2312 100644 --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h @@ -427,7 +427,7 @@ struct c4iw_cq { struct t4_cq cq; spinlock_t lock; spinlock_t comp_handler_lock; - atomic_t refcnt; + refcount_t refcnt; wait_queue_head_t wait; struct c4iw_wr_wait *wr_waitp; }; |