[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250711164226.GE1951027@nvidia.com>
Date: Fri, 11 Jul 2025 13:42:26 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: will@...nel.org, joro@...tes.org, kevin.tian@...el.com,
baolu.lu@...ux.intel.com, linux-arm-kernel@...ts.infradead.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH rc] iommu/arm-smmu-v3: Revert vmaster in the error path
On Thu, Jul 10, 2025 at 04:30:03PM -0700, Nicolin Chen wrote:
> The error path in the arm_smmu_attach_prepare() was introduced with the
> arm_smmu_enable_iopf(). Due to a rebase issue, it forgot to include the
> revert of the vmaster.
>
> Move kfree(state->vmaster) to the error path, to prevent memory leak.
>
> Fixes: cfea71aea921 ("iommu/arm-smmu-v3: Put iopf enablement in the domain attach path")
> Cc: stable@...r.kernel.org
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
The patch is fine but the commit message is a bit confusing
The error path for err_free_master_domain leaks the vmaster. Move all
the kfrees for vmaster into the goto error section..
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists