RDMA/core: Use refcount_t instead of atomic_t on refcount of mcast_port
authorWeihang Li <liweihang@huawei.com>
Fri, 28 May 2021 09:37:36 +0000 (17:37 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Jun 2021 17:45:07 +0000 (14:45 -0300)
commit58d33b4fa9d7926535c0f2d30bdb21d2e06e6047
treeef858f5d8dbec0c305297a8bedc882533e7e5fe9
parentcd74db6cbb1e5a9d9103ccb41aca777d0e4298cd
RDMA/core: Use refcount_t instead of atomic_t on refcount of mcast_port

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-6-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/multicast.c