From nobody Mon May 30 18:22:57 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2C16E1B4A133; Mon, 30 May 2022 18:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LBkKt07KDz3GNk; Mon, 30 May 2022 18:22:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653934978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLSNc6bYI20o7+jGSft0p43FiQnAW9V/nJ0fXl/oXUs=; b=Iz0Nm7p+xR0e/h+9xvu/wIjRBUm42ltzzvzmZkGcFnk3fFTs62Rv4YM4/MSmtK5MvcLXWs HbuZlFRocLAaTIAP78Ik92074pSRpmK3MwvnMBL9GlEmjJragx6oQ0eyyO4lNTBjadMvcb 2TLvBpog7PM6DSVdryTIOEPu1Cqivve+nOPKv5+VLDCFZ03MP1LPqbiY+z3BV6q2/m8I9m uE1pjIURvKvB+ev6R2md9Y6HhmLx70eGmAxeIJUeARd2qKczlIB1dOW6Eo3/3YnViOi5Fu ZDl+Vonf7UGGb/uBf9i6gKYsqRL8BnWIPePNW1g78TpIywCb3UjsyDYm+wqkZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7A281C3D8; Mon, 30 May 2022 18:22:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24UIMvjd075114; Mon, 30 May 2022 18:22:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24UIMvRI075113; Mon, 30 May 2022 18:22:57 GMT (envelope-from git) Date: Mon, 30 May 2022 18:22:57 GMT Message-Id: <202205301822.24UIMvRI075113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: c4a415505311 - main - ibcore: Fix missing ib_cm_destroy_id() in ib_cm_insert_listen() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4a415505311e30093b6d9ee0493427a66f2b0de Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653934978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FLSNc6bYI20o7+jGSft0p43FiQnAW9V/nJ0fXl/oXUs=; b=MGTyn9+DkLP1V4aalgCb7fcs7nqY4rxFo1l7Nqeo0zlOxqLdd6GA3SeDGXfWFUchqqLoxT o2TA4spe0hvm5wskgFXQE2jSoGOXlimXkb+4TI6qgiBCq+ZbiRqnIuW81qzDwpmLMsodI1 zcvButPmpIIcVIHC8p6318EvOgNGD/+PyrGGHCDmA4ZKBLdR9Nec+uhWwjhQNbWsOQzZ1M wxJHJWfFRNOkafli96vL5Xhi3bvN0qx6WjBMxY6cma0lJ5mYH4RI4Nly8UvrEj7TEDSFkp 2aRw6dhJoU3wVxoqKjmxy9Yyoq8qJ92eC6m39ICvyYzrvClpkEjpkZBJsWA9NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653934978; a=rsa-sha256; cv=none; b=QviPdDEXJ7kDj7KfnN995NsGnD8QgrYrlJC9AKlxhUKhPvQFQ0lMhwyuVFKf+3rQVA+tdk HZ8xPRoHd4jKK+UnXMhXh2pf+nm9kWTndkRmX3nx+BdVoYVeF3o4o1KJ4R7akGBJLT2kQp 2Kwm+2u+TJG6BfWgUGNS7MlZIP3QIyP0mj6SeTaXgh2EcYFHqTzjiTTeghoab3eKFBGU+H aIKG90DCHiI41RG3mHdLIA3UJFIUrQL8FlzUUUeiBVSJidlD1wJmtdTMlRLcmdPSJzi9zL l2An1wwPrl6E+0K0RarqPfheBgb08K2MBaly356UaF0HVWgDim7zwGrLJvemKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=c4a415505311e30093b6d9ee0493427a66f2b0de commit c4a415505311e30093b6d9ee0493427a66f2b0de Author: Hans Petter Selasky AuthorDate: 2022-05-30 18:19:33 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-30 18:22:18 +0000 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_cm.c b/sys/ofed/drivers/infiniband/core/ib_cm.c index 6d8a4e24db47..45f316252b69 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cm.c +++ b/sys/ofed/drivers/infiniband/core/ib_cm.c @@ -1179,6 +1179,7 @@ struct ib_cm_id *ib_cm_insert_listen(struct ib_device *device, /* Sharing an ib_cm_id with different handlers is not * supported */ spin_unlock_irqrestore(&cm.lock, flags); + ib_destroy_cm_id(cm_id); return ERR_PTR(-EINVAL); } atomic_inc(&cm_id_priv->refcount);