From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46A24C4332F for ; Wed, 2 Nov 2022 01:38:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=klcDQ0iPz98vCwCwomVY9ZAqNydMGzHtu1wXRNNwQTg=; b=KrGfBB5Y/ZOhZQqEheocaHSt9i f4YLeJ7iXWfR8+OnMx11ilMvGGmrgD61+Hdx+eERounfDhfqV52esB60+47MjvgF7vjNVr5zn6SUu YTcOb/2M+UdM3bWLibRlitB8CjOJH9xKYFrc08TAhRL9u6DqCUX8f3srYMOMsgv2jY62cUCg6lVQf 51zIiXtHnELBFm4L7ouDhH7K4HcH4fZo++/qMt9HyisQTjO+jREsNqY+F9dDYH9pYD+xPAs418zU9 QzxTsw92hnFayfsQlp/bFPU//Z9Fw43jbFSuDBQ+IdwSZwgU4iHPL2L3LTGZIR56blJgBSWW0/rz8 1L5SxdlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oq2gd-007vqv-2Y; Wed, 02 Nov 2022 01:36:59 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oq2gY-007vpK-RB for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 01:36:57 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N28cV1FgPzHvXq; Wed, 2 Nov 2022 09:36:26 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 2 Nov 2022 09:36:44 +0800 Received: from [10.67.103.158] (10.67.103.158) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 2 Nov 2022 09:36:44 +0800 Subject: Re: [PATCH 1/2] iommu: fix memory leak of iopf To: , CC: , References: <20221021035147.15292-1-liulongfang@huawei.com> <20221021035147.15292-2-liulongfang@huawei.com> From: liulongfang Message-ID: Date: Wed, 2 Nov 2022 09:36:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20221021035147.15292-2-liulongfang@huawei.com> X-Originating-IP: [10.67.103.158] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221101_183655_098788_54FF584F X-CRM114-Status: GOOD ( 15.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org kindly ping! On 2022/10/21 11:51, Longfang Liu wrote: > In arm_smmu_init_queues(), if ARM_SMMU_FEAT_SVA and ARM_SMMU_FEAT_STALLS > are enabled, iopf will be allocated a queue memory, and after > arm_smmu_init_one_queue() processing fails, this part of iopf > memory is not released, and there is a memory leak problem. > > Signed-off-by: Longfang Liu > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index b788a38d8fdf..a1db07bed6a9 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -2939,9 +2939,13 @@ static int arm_smmu_init_queues(struct arm_smmu_device *smmu) > if (!(smmu->features & ARM_SMMU_FEAT_PRI)) > return 0; > > - return arm_smmu_init_one_queue(smmu, &smmu->priq.q, smmu->page1, > + ret = arm_smmu_init_one_queue(smmu, &smmu->priq.q, smmu->page1, > ARM_SMMU_PRIQ_PROD, ARM_SMMU_PRIQ_CONS, > PRIQ_ENT_DWORDS, "priq"); > + if (ret) > + iopf_queue_free(smmu->evtq.iopf); > + > + return ret; > } > > static int arm_smmu_init_l1_strtab(struct arm_smmu_device *smmu) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel