[PATCH] iommu: Free fwspec with the dev_iommu object

Joerg Roedel joro at 8bytes.org
Fri May 1 11:23:52 UTC 2020


Hi Jean-Philippe,

On Wed, Apr 22, 2020 at 03:55:14PM +0200, Jean-Philippe Brucker wrote:
> Fix this leak by freeing the fwspec in dev_iommu_free().
> 
> Fixes: 72acd9df18f1 ("iommu: Move iommu_fwspec to struct dev_iommu")
> Signed-off-by: Jean-Philippe Brucker <jean-philippe at linaro.org>
> ---
>  drivers/iommu/iommu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 2b471419e26c3..54757c404866c 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -170,6 +170,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev)
>  
>  static void dev_iommu_free(struct device *dev)
>  {
> +	iommu_fwspec_free(dev);
>  	kfree(dev->iommu);
>  	dev->iommu = NULL;
>  }

Sorry, but [1] is already queued.

Thanks,

	Joerg

[1] https://lore.kernel.org/r/20200402143749.40500-1-haokexin@gmail.com



More information about the iommu mailing list