From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com,
kernel@pengutronix.de, Abel Vesa <abelvesa@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Peng Fan <peng.fan@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
Zhanhao Hu <zero12113@hust.edu.cn>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: [cocci] [PATCH] clk: imx93: Fix an error code assignment in imx93_clocks_probe()
Date: Tue, 13 Jun 2023 22:12:39 +0200 [thread overview]
Message-ID: <cf7b69f4-c4b2-5160-e19a-14c272b0dc6e@web.de> (raw)
In-Reply-To: <20230601033825.336558-1-zero12113@hust.edu.cn>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 13 Jun 2023 21:50:50 +0200
The variable “base” was passed to a call of the function “PTR_ERR”
in the implementation of the function “imx93_clocks_probe”.
Unfortunately, the variable was not assigned to an error pointer
before this if branch.
Thus use the variable “anatop_base” for an error code assignment instead.
Fixes: e02ba11b4576 ("clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/clk/imx/clk-imx93.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c
index b6c7c2725906..44f435103c65 100644
--- a/drivers/clk/imx/clk-imx93.c
+++ b/drivers/clk/imx/clk-imx93.c
@@ -291,7 +291,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)
anatop_base = devm_of_iomap(dev, np, 0, NULL);
of_node_put(np);
if (WARN_ON(IS_ERR(anatop_base))) {
- ret = PTR_ERR(base);
+ ret = PTR_ERR(anatop_base);
goto unregister_hws;
}
--
2.41.0
next parent reply other threads:[~2023-06-13 20:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230601033825.336558-1-zero12113@hust.edu.cn>
2023-06-13 20:12 ` Markus Elfring [this message]
2024-01-05 20:00 ` [cocci] [PATCH] clk: imx93: Fix an error code assignment in imx93_clocks_probe() Markus Elfring
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=cf7b69f4-c4b2-5160-e19a-14c272b0dc6e@web.de \
--to=markus.elfring@web.de \
--cc=abelvesa@kernel.org \
--cc=cocci@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
--cc=zero12113@hust.edu.cn \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).