
Some providers need to access ibv_srq->pd during SRQ destruction, but it may not be assigned currently when using ibv_create_srq_ex(). This may lead to some SRQ-related resource leaks. Assign ibv_srq->pd when creating SRQ to ensure pd can be obtained correctly. Fixes: 40c1365b2198 ("Add support for XRC SRQs") Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> --- libibverbs/cmd_srq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libibverbs/cmd_srq.c b/libibverbs/cmd_srq.c index dfaaa6aa2..259ea0d10 100644 --- a/libibverbs/cmd_srq.c +++ b/libibverbs/cmd_srq.c @@ -63,6 +63,7 @@ static int ibv_icmd_create_srq(struct ibv_pd *pd, struct verbs_srq *vsrq, struct verbs_xrcd *vxrcd = NULL; enum ibv_srq_type srq_type; + srq->pd = pd; srq->context = pd->context; pthread_mutex_init(&srq->mutex, NULL); pthread_cond_init(&srq->cond, NULL); -- 2.33.0