All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miaoqian Lin <linmq006@gmail.com>
To: sboyd@kernel.org
Cc: jonathanh@nvidia.com, linmq006@gmail.com,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org, mturquette@baylibre.com,
	pdeschrijver@nvidia.com, pgaikwad@nvidia.com,
	thierry.reding@gmail.com
Subject: [PATCH v2] clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver
Date: Wed, 12 Jan 2022 10:45:01 +0000	[thread overview]
Message-ID: <20220112104501.30655-1-linmq006@gmail.com> (raw)
In-Reply-To: <20220112025200.95C4BC36AEB@smtp.kernel.org>

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: 2db04f16b589 ("clk: tegra: Add EMC clock driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
Changes in v2:
- add fixes tag.
---
 drivers/clk/tegra/clk-tegra124-emc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c
index 74c1d894cca8..219c80653dbd 100644
--- a/drivers/clk/tegra/clk-tegra124-emc.c
+++ b/drivers/clk/tegra/clk-tegra124-emc.c
@@ -198,6 +198,7 @@ static struct tegra_emc *emc_ensure_emc_driver(struct tegra_clk_emc *tegra)
 
 	tegra->emc = platform_get_drvdata(pdev);
 	if (!tegra->emc) {
+		put_device(&pdev->dev);
 		pr_err("%s: cannot find EMC driver\n", __func__);
 		return NULL;
 	}
-- 
2.17.1


  reply	other threads:[~2022-01-12 10:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07  8:24 [PATCH] clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver Miaoqian Lin
2022-01-12  2:51 ` Stephen Boyd
2022-01-12 10:45   ` Miaoqian Lin [this message]
2022-02-25 13:16     ` [PATCH v2] " Thierry Reding

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=20220112104501.30655-1-linmq006@gmail.com \
    --to=linmq006@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=pdeschrijver@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=sboyd@kernel.org \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.