Skip to content

Commit fc5ef89

Browse files
Saravanan Vajravelsmb49
authored andcommitted
RDMA/core: Fix GID entry ref leak when create_ah fails
BugLink: https://bugs.launchpad.net/bugs/2023328 [ Upstream commit aca3b0f ] If AH create request fails, release sgid_attr to avoid GID entry referrence leak reported while releasing GID table Fixes: 1a1f460 ("RDMA: Hold the sgid_attr inside the struct ib_ah/qp") Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Selvin Xavier <[email protected]> Signed-off-by: Saravanan Vajravel <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Luke Nowakowski-Krijger <[email protected]>
1 parent c1c60f9 commit fc5ef89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/infiniband/core/verbs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
540540
else
541541
ret = device->ops.create_ah(ah, &init_attr, NULL);
542542
if (ret) {
543+
if (ah->sgid_attr)
544+
rdma_put_gid_attr(ah->sgid_attr);
543545
kfree(ah);
544546
return ERR_PTR(ret);
545547
}

0 commit comments

Comments
 (0)