From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9CC1C433F5 for ; Mon, 31 Jan 2022 15:26:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 42846408F8; Mon, 31 Jan 2022 15:26:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rRvKEvqoAlxN; Mon, 31 Jan 2022 15:26:05 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id CD7E94038E; Mon, 31 Jan 2022 15:26:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9943AC001A; Mon, 31 Jan 2022 15:26:04 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 75281C000B for ; Mon, 31 Jan 2022 15:26:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4E8B683F83 for ; Mon, 31 Jan 2022 15:26:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pZeJuv9UO3Dg for ; Mon, 31 Jan 2022 15:26:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by smtp1.osuosl.org (Postfix) with ESMTPS id 523B782784 for ; Mon, 31 Jan 2022 15:26:01 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id E3CD84DC; Mon, 31 Jan 2022 16:25:57 +0100 (CET) Date: Mon, 31 Jan 2022 16:25:56 +0100 From: Joerg Roedel To: Miaoqian Lin , Thierry Reding Subject: Re: [PATCH] iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find Message-ID: References: <20220107080915.12686-1-linmq006@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220107080915.12686-1-linmq006@gmail.com> Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Jonathan Hunter , linux-tegra@vger.kernel.org, Will Deacon X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" 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 > --- > 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 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu