linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>, Bai Ping <ping.bai@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	NXP Linux Team <linux-imx@nxp.com>, Peng Fan <peng.fan@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	Zhou Shide <u201911681@hust.edu.cn>
Cc: hust-os-kernel-patches@googlegroups.com,
	Zhou Shide <u201911681@hust.edu.cn>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Hao Luo <m202171776@hust.edu.cn>
Subject: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in 'imx8mm_clocks_probe'
Date: Thu, 13 Apr 2023 12:06:59 -0700	[thread overview]
Message-ID: <25b06794ffb595229019640e10f256fd.sboyd@kernel.org> (raw)
In-Reply-To: <20230413032439.1706448-1-u201911681@hust.edu.cn>

Quoting Zhou Shide (2023-04-12 20:24:39)
> The function imx8mm_clocks_probe() has two main issues:
> - The of_iomap() function may cause a memory leak.
> - Memory allocated for 'clk_hw_data' may not be freed properly
> in some paths.
> 
> To fix these issues, this commit replaces the use of of_iomap()
> with devm_of_iomap() and replaces kzalloc() with devm_kzalloc().
> This ensures that all memory is properly managed and automatically
> freed when the device is removed.
> 
> In addition, when devm_of_iomap() allocates memory with an error,
> it will first jump to label "unregister_hws" and
> then return PTR_ ERR(base).
> 
> Fixes: 9c71f9ea35d7 ("clk: imx: imx8mm: Switch to clk_hw based API")
> Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
> Signed-off-by: Zhou Shide <u201911681@hust.edu.cn>
> ---
> The issue is discovered by static analysis, and the patch is not tested yet.

And you're not coordinating with each other?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-04-13 19:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  3:24 [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in 'imx8mm_clocks_probe' Zhou Shide
2023-04-13 19:06 ` Stephen Boyd [this message]
2023-04-14  2:02   ` 周师德
2023-04-18 19:57     ` Stephen Boyd
2023-04-19  0:55       ` Dongliang Mu
2023-04-14 16:38   ` Dan Carpenter
2023-04-15  1:55     ` Dongliang Mu
2023-04-25  2:06 ` 周师德
2023-04-28  7:50 ` Peng Fan

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=25b06794ffb595229019640e10f256fd.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=abelvesa@kernel.org \
    --cc=festevam@gmail.com \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --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=m202171776@hust.edu.cn \
    --cc=mturquette@baylibre.com \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=u201911681@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 NNTP newsgroup(s).