Re: [PATCH] iommu/ipmmu-vmsa: fix device reference leaks

From: Laurent Pinchart
Date: Tue Feb 12 2019 - 11:47:30 EST


Hello,

Wen, thank you for the patch.

On Mon, Feb 11, 2019 at 11:24:15AM +0100, joro@xxxxxxxxxx wrote:
> Adding a few more people to Cc.
>
> On Sun, Feb 03, 2019 at 10:27:09AM +0000, wen yang wrote:
> > Make sure to drop the reference to the device taken by
> > of_find_device_by_node() on driver unbind.
> >
> > Signed-off-by: Wen Yang <yellowriver2010@xxxxxxxxxxx>
> > Cc: Joerg Roedel <joro@xxxxxxxxxx>
> > Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
> > Cc: linux-kernel@xxxxxxxxxxxxxxx
> > ---
> > drivers/iommu/ipmmu-vmsa.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
> > index 7a4529c..cebf56d 100644
> > --- a/drivers/iommu/ipmmu-vmsa.c
> > +++ b/drivers/iommu/ipmmu-vmsa.c
> > @@ -756,6 +756,9 @@ static int ipmmu_init_platform_device(struct device *dev,
> >
> > fwspec->iommu_priv = platform_get_drvdata(ipmmu_pdev);
> >
> > + if (!fwspec->iommu_priv)
> > + put_device(&ipmmu_pdev->dev);
> > +

This doesn't seem to match the patch's subject, and doesn't seem to fix
the problem.

> > return 0;
> > }
> >

--
Regards,

Laurent Pinchart