Re: [PATCH] RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT

From: Leon Romanovsky

Date: Fri Sep 18 2026 - 08:50:21 EST



On Wed, 16 Sep 2026 16:55:29 +0800, lirongqing wrote:
> The UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via
> ib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the
> kref to 1) and rdma_restrack_set_name(NULL), the latter attaching the
> current task and taking a task_struct reference. When ib_init_ucontext()
> subsequently fails, the error path only does:
>
> kfree(attrs->context);
> attrs->context = NULL;
>
> [...]

Applied, thanks!

[1/1] RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT
https://git.kernel.org/rdma/rdma/c/9dcacdc41083cc

Best regards,
--
Leon Romanovsky <leon@xxxxxxxxxx>