[PATCH 07/10] iommu/ipmmu-vmsa: Convert to generic_single_device_group()
Jason Gunthorpe
jgg at nvidia.com
Fri Jul 21 05:04:07 PDT 2023
On Fri, Jul 21, 2023 at 07:20:21AM +0000, Tian, Kevin wrote:
> > 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().
IIRC many of the drivers had this, or other bugs here.
> While at it could you add a patch to fix it allowing backport and then this
> patch to convert to the generic helper?
It isn't worth it, these drivers are never removed, so it is a bug
that nobody will ever hit.
Jason
More information about the Linux-rockchip
mailing list