OSDN Git Service

RDMA/core: Use refcount_t instead of atomic_t on refcount of iwcm_id_private
authorWeihang Li <liweihang@huawei.com>
Fri, 28 May 2021 09:37:32 +0000 (17:37 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Jun 2021 17:35:44 +0000 (14:35 -0300)
commit60dff56d77292062789232f68354f567e1ccf1d2
tree5e8f23a28e3a832b086d6b3e0ff6beedf1dcf45d
parent61c7d826b81769ea57d094305c900f903768f322
RDMA/core: Use refcount_t instead of atomic_t on refcount of iwcm_id_private

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-2-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/iwcm.c
drivers/infiniband/core/iwcm.h