]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/uverbs: Fix umem release in UVERBS_METHOD_CQ_CREATE
authorShuhao Fu <sfual@cse.ust.hk>
Fri, 10 Oct 2025 02:55:17 +0000 (10:55 +0800)
committerLeon Romanovsky <leon@kernel.org>
Sun, 19 Oct 2025 11:31:25 +0000 (07:31 -0400)
commitd8713158faad0fd4418cb2f4e432c3876ad53a1f
treea17a9c30d95e19215f5d0a0e58cb53aeb7a159f2
parent5575b7646b94c0afb0f4c0d86e00e13cf3397a62
RDMA/uverbs: Fix umem release in UVERBS_METHOD_CQ_CREATE

In `UVERBS_METHOD_CQ_CREATE`, umem should be released if anything goes
wrong. Currently, if `create_cq_umem` fails, umem would not be
released or referenced, causing a possible leak.

In this patch, we release umem at `UVERBS_METHOD_CQ_CREATE`, the driver
should not release umem if it returns an error code.

Fixes: 1a40c362ae26 ("RDMA/uverbs: Add a common way to create CQ with umem")
Signed-off-by: Shuhao Fu <sfual@cse.ust.hk>
Link: https://patch.msgid.link/aOh1le4YqtYwj-hH@osx.local
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/core/uverbs_std_types_cq.c
drivers/infiniband/hw/efa/efa_verbs.c