[PATCH 07/10] iommu/ipmmu-vmsa: Convert to generic_single_device_group()

Tian, Kevin kevin.tian at intel.com
Fri Jul 21 00:20:21 PDT 2023


> From: Jason Gunthorpe <jgg at nvidia.com>
> Sent: Wednesday, July 19, 2023 3:06 AM
> 
> -static struct iommu_group *ipmmu_find_group(struct device *dev)
> -{
> -	struct ipmmu_vmsa_device *mmu = to_ipmmu(dev);
> -	struct iommu_group *group;
> -
> -	if (mmu->group)
> -		return iommu_group_ref_get(mmu->group);
> -
> -	group = iommu_group_alloc();
> -	if (!IS_ERR(group))
> -		mmu->group = group;
> -
> -	return group;
> -}

Looks existing code has a leak w/o freeing the group in ipmmu_remove().

While at it could you add a patch to fix it allowing backport and then this
patch to convert to the generic helper?



More information about the linux-arm-kernel mailing list