RDMA/hns: Use refcount_t APIs for HEM
authorWeihang Li <liweihang@huawei.com>
Fri, 21 May 2021 09:29:54 +0000 (17:29 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 May 2021 23:13:58 +0000 (20:13 -0300)
commit82eb481da64586ccd287b2b2c5a086202c65e7eb
treeeaa94e5196cc97dfcd66779d9f1c97b228bae39d
parent5e6370d7cc75134b0eb5b15916aab40b628db9e1
RDMA/hns: Use refcount_t APIs for HEM

refcount_t is better than integer for reference counting, it will WARN on
overflow/underflow and avoid use-after-free risks.

Link: https://lore.kernel.org/r/1621589395-2435-5-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_hem.c
drivers/infiniband/hw/hns/hns_roce_hem.h