Skip to content

Commit d235a3a

Browse files
Junxian Huangnmorey
authored andcommitted
verbs: Assign ibv srq->pd when creating SRQ
[ Upstream commit bf1e427 ] 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: 40c1365 ("Add support for XRC SRQs") Signed-off-by: Junxian Huang <[email protected]> Signed-off-by: Nicolas Morey <[email protected]>
1 parent 8a739f6 commit d235a3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libibverbs/cmd_srq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static int ibv_icmd_create_srq(struct ibv_pd *pd, struct verbs_srq *vsrq,
6363
struct verbs_xrcd *vxrcd = NULL;
6464
enum ibv_srq_type srq_type;
6565

66+
srq->pd = pd;
6667
srq->context = pd->context;
6768
pthread_mutex_init(&srq->mutex, NULL);
6869
pthread_cond_init(&srq->cond, NULL);

0 commit comments

Comments
 (0)