ibcore: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen()
authorHans Petter Selasky <hselasky@FreeBSD.org>
Mon, 30 May 2022 18:19:33 +0000 (20:19 +0200)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Mon, 30 May 2022 18:22:18 +0000 (20:22 +0200)
commitc4a415505311e30093b6d9ee0493427a66f2b0de
tree25525f1d04f9c45fe9fe1afc12e215704f3c8c4c
parentf29c9901a41fb650d46fd48f4880a894f54aa737
ibcore: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen()

The algorithm pre-allocates a cm_id since allocation cannot be done while
holding the cm.lock spinlock, however it doesn't free it on one error
path, leading to a memory leak.

Linux commit:
c14dfddbd869bf0c2bafb7ef260c41d9cebbcfec

PR: 264248
MFC after: 1 week
Sponsored by: NVIDIA Networking
sys/ofed/drivers/infiniband/core/ib_cm.c