From: Suman Anna <s-anna@ti.com>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
<iommu@lists.linux-foundation.org>,
<linux-kernel@vger.kernel.org>, "Nagalla, Hari" <hnagalla@ti.com>
Subject: Re: [PATCH] iommu/omap: Fix missing put_device() call in omap_iommu_probe_device
Date: Fri, 7 Jan 2022 08:42:16 -0600 [thread overview]
Message-ID: <de3a3e1c-6c51-e951-cc7f-9ce2ccb3f283@ti.com> (raw)
In-Reply-To: <20220107080428.10873-1-linmq006@gmail.com>
Hi Miaoqian,
On 1/7/22 2:04 AM, Miaoqian Lin wrote:
> The reference taken by 'of_find_device_by_node()' must be released when
> not needed anymore.
Thanks for catching this.
> Add the corresponding 'put_device()' in the error handling paths.
Also, need it in the regular path, not just in error handling path.
>
> Fixes: ede1c2e7d4dc ("iommu/omap: Store iommu_dev pointer in arch_data")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
> drivers/iommu/omap-iommu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
> index 91749654fd49..cbc7ca5e890a 100644
> --- a/drivers/iommu/omap-iommu.c
> +++ b/drivers/iommu/omap-iommu.c
> @@ -1684,6 +1684,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
> oiommu = platform_get_drvdata(pdev);
> if (!oiommu) {
> of_node_put(np);
> + put_device(&pdev->dev);
nit, doesn't matter for functionality, but prefer the put_device before
of_node_put().
regards
Suman
> kfree(arch_data);
> return ERR_PTR(-EINVAL);
> }
>
next prev parent reply other threads:[~2022-01-07 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 8:04 Miaoqian Lin
2022-01-07 14:42 ` Suman Anna [this message]
2022-01-10 2:43 ` Miaoqian Lin
2022-01-10 18:43 ` Suman Anna
2022-01-12 11:54 ` Miaoqian Lin
2022-03-01 6:33 ` [PATCH v2] " Miaoqian Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de3a3e1c-6c51-e951-cc7f-9ce2ccb3f283@ti.com \
--to=s-anna@ti.com \
--cc=hnagalla@ti.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®