Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: liulongfang <liulongfang@huawei.com>
To: <will@kernel.org>, <robin.murphy@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>
Subject: Re: [PATCH 1/2] iommu: fix memory leak of iopf
Date: Wed, 2 Nov 2022 09:36:43 +0800	[thread overview]
Message-ID: <d4f9a31e-41cb-16a0-b071-976dacacc07c@huawei.com> (raw)
In-Reply-To: <20221021035147.15292-2-liulongfang@huawei.com>

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 <liulongfang@huawei.com>
> ---
>  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

  reply	other threads:[~2022-11-02  1:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  3:51 [PATCH 0/2] fix the memory leak of iopf Longfang Liu
2022-10-21  3:51 ` [PATCH 1/2] iommu: fix " Longfang Liu
2022-11-02  1:36   ` liulongfang [this message]
2022-10-21  3:51 ` [PATCH 2/2] iommu: fix smmu initialization memory leak problem Longfang Liu
2022-11-14 18:08   ` Will Deacon
2022-11-18  9:28     ` liulongfang
2022-11-18 11:54       ` Robin Murphy
2022-11-21  2:09         ` liulongfang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4f9a31e-41cb-16a0-b071-976dacacc07c@huawei.com \
    --to=liulongfang@huawei.com \
    --cc=iommu@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox