Message ID | 20231207114231.2872104-6-huangjunxian6@hisilicon.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4721417vqy; Thu, 7 Dec 2023 03:46:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHH9/hdMREjNrVf8ByHJ94Tv0VDkKeBu8neOIcsoAAHGR/bKmU7SVY/hWJ6mvt9tLD7ncGO X-Received: by 2002:a17:902:7c09:b0:1d0:8595:ea7f with SMTP id x9-20020a1709027c0900b001d08595ea7fmr5322413pll.46.1701949600544; Thu, 07 Dec 2023 03:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701949600; cv=none; d=google.com; s=arc-20160816; b=PylO+xtbpnfMZFREetNz4iaL5AQqPdkcwaAnb4Lcbyq6VPD6aIzjV/xKxumjaa5MDO Ft6XuVxZQN+KqhSULoQv40zwsoRLGYdKu7l1oOd4+8eFOrYMDQu7OlKUwLHVkpDPWA6F /PbnauFHG3Fu0eneAV7Hp/oL36V5BD0KnQf9bJ3B4MvFAxCV9SyVIqLi9RIg1dD4GRTv rCO/q+kZb+S33/UGmp6DE1HfxpdtpymBkiOdvO0mKSrX/GtntapjpkItlpq3G8QmcL3k cLZCLeAgVyukpfbHVKTqdJdBnceJhQJeuA+BHkgut+W2ayH7wmr1YlKZwN3V5F3UXXnz 86oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BEcdQrr+dn6fBBxVR2xDt4B1CMQqSOwnf9q6ouQmNXk=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=SpWRCFkWgBV9bae57m4FPT1G+1NbrKN8013/0/c6NeLrPCnSL9dbilRFEaycAMN40Z UA3ZcALBG7vBUQ0xVejdCkzcwd0H49XQ4vW5jDOIgXGDfFhRFw/sr649Jtjbof/BN19q y/mExZokXoSg725F4sY1Q+4a1UsM+bIgUGo/SFNNVSVzqy84EYegjQ6Rke5p11IMfsc4 JZsP+gxzwEWeqr7uxyEyvE+cQIynTtcBAkM9jsyd63A9HkdxM6aYmlF7Di2y5eGiFnv2 Y2Is7v9LTAkcNR29RC76wEORI/eQH0Oo0+3XoVf6lziayRJf1YuZqvZz3n1/u64DWfiO ntFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m9-20020a170902db0900b001cfb6a814aesi1050158plx.255.2023.12.07.03.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 03:46:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BD63A8053C43; Thu, 7 Dec 2023 03:46:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379025AbjLGLqX (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Thu, 7 Dec 2023 06:46:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232498AbjLGLqF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 7 Dec 2023 06:46:05 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E27BBD5C; Thu, 7 Dec 2023 03:46:11 -0800 (PST) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SmCBK6bYGzWjKL; Thu, 7 Dec 2023 19:45:13 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 7 Dec 2023 19:46:09 +0800 From: Junxian Huang <huangjunxian6@hisilicon.com> To: <jgg@ziepe.ca>, <leon@kernel.org> CC: <linux-rdma@vger.kernel.org>, <linuxarm@huawei.com>, <linux-kernel@vger.kernel.org>, <huangjunxian6@hisilicon.com> Subject: [PATCH v2 for-next 5/5] RDMA/hns: Fix memory leak in free_mr_init() Date: Thu, 7 Dec 2023 19:42:31 +0800 Message-ID: <20231207114231.2872104-6-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231207114231.2872104-1-huangjunxian6@hisilicon.com> References: <20231207114231.2872104-1-huangjunxian6@hisilicon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500006.china.huawei.com (7.221.188.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 03:46:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784623504280203149 X-GMAIL-MSGID: 1784623504280203149 |
Series |
Bugfixes and improvements for hns RoCE
|
|
Commit Message
Junxian Huang
Dec. 7, 2023, 11:42 a.m. UTC
From: Chengchang Tang <tangchengchang@huawei.com> When a reserved QP fails to be created, the memory of the remaining created reserved QPs is leaked. Fixes: 70f92521584f ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT") Signed-off-by: Chengchang Tang <tangchengchang@huawei.com> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com> --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 93a71db527d8..b8dde04bd573 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -2710,6 +2710,10 @@ static int free_mr_alloc_res(struct hns_roce_dev *hr_dev) return 0; create_failed_qp: + for (i--; i >= 0; i--) { + hns_roce_v2_destroy_qp(&free_mr->rsv_qp[i]->ibqp, NULL); + kfree(free_mr->rsv_qp[i]); + } hns_roce_destroy_cq(cq, NULL); kfree(cq);