[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yff/hImeZQiQ9iYV@8bytes.org>
Date: Mon, 31 Jan 2022 16:25:56 +0100
From: Joerg Roedel <joro@...tes.org>
To: Miaoqian Lin <linmq006@...il.com>,
Thierry Reding <thierry.reding@...il.com>
Cc: Krishna Reddy <vdumpa@...dia.com>, Will Deacon <will@...nel.org>,
Jonathan Hunter <jonathanh@...dia.com>,
Nicolin Chen <nicoleotsuka@...il.com>,
linux-tegra@...r.kernel.org, iommu@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu/tegra-smmu: Fix missing put_device() call in
tegra_smmu_find
Thierry,
does this look correct to you?
Thanks,
Joerg
On Fri, Jan 07, 2022 at 08:09:11AM +0000, Miaoqian Lin wrote:
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore.
> Add the corresponding 'put_device()' in the error handling path.
>
> Fixes: 765a9d1d02b2 ("iommu/tegra-smmu: Fix mc errors on tegra124-nyan")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
> drivers/iommu/tegra-smmu.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
> index e900e3c46903..2561ce8a2ce8 100644
> --- a/drivers/iommu/tegra-smmu.c
> +++ b/drivers/iommu/tegra-smmu.c
> @@ -808,8 +808,10 @@ static struct tegra_smmu *tegra_smmu_find(struct device_node *np)
> return NULL;
>
> mc = platform_get_drvdata(pdev);
> - if (!mc)
> + if (!mc) {
> + put_device(&pdev->dev);
> return NULL;
> + }
>
> return mc->smmu;
> }
> --
> 2.17.1
Powered by blists - more mailing lists