]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/core: Use refcount_t instead of atomic_t on refcount of ib_uverbs_device
authorWeihang Li <liweihang@huawei.com>
Fri, 28 May 2021 09:37:38 +0000 (17:37 +0800)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Jun 2021 18:04:36 +0000 (15:04 -0300)
commit41d69048e2cbd58b7954beec606db40f98ef1499
tree0deb7c0393d151262cfb2e41bd019889fd3de5a9
parent8dbb51c1262c5bff5e851839b8f1c4d12ce7a826
RDMA/core: Use refcount_t instead of atomic_t on refcount of ib_uverbs_device

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-8-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/uverbs.h
drivers/infiniband/core/uverbs_main.c