RDMA/hns: Use refcount_t instead of atomic_t for CQ reference counting
authorWeihang Li <liweihang@huawei.com>
Fri, 28 May 2021 09:37:39 +0000 (17:37 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Jun 2021 17:56:11 +0000 (14:56 -0300)
commitcc9e5a844ab8139085d28efdda9ae1d5625a5319
treed03f2d25a579924d0432bfcf74b55fb510a685a3
parent58d33b4fa9d7926535c0f2d30bdb21d2e06e6047
RDMA/hns: Use refcount_t instead of atomic_t for CQ 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-9-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_cq.c
drivers/infiniband/hw/hns/hns_roce_device.h