RDMA/ipoib: Use refcount_t instead of atomic_t for reference counting
authorWeihang Li <liweihang@huawei.com>
Fri, 28 May 2021 09:37:43 +0000 (17:37 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Jun 2021 18:00:04 +0000 (15:00 -0300)
commita5e27fb68fcce3885cfc02a1ecd7d02fe3f02a34
tree010507671ed2c34faa6235fea8833df58e7a9517
parent7183451f846d22e9fee665756824c9c2cc9cf377
RDMA/ipoib: 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-13-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_main.c