mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 周师德 <u201911681@hust.edu.cn>
To: "stephen boyd" <sboyd@kernel.org>
Cc: "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>,
	hust-os-kernel-patches@googlegroups.com,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "hao luo" <m202171776@hust.edu.cn>
Subject: Re: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in 'imx8mm_clocks_probe'
Date: Fri, 14 Apr 2023 10:02:19 +0800 (GMT+08:00)	[thread overview]
Message-ID: <5e18370b.3c8a8.1877d7fc98a.Coremail.u201911681@hust.edu.cn> (raw)
In-Reply-To: <25b06794ffb595229019640e10f256fd.sboyd@kernel.org>




> -----原始邮件-----
> 发件人: "Stephen Boyd" <sboyd@kernel.org>
> 发送时间: 2023-04-14 03:06:59 (星期五)
> 收件人: "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>
> 抄送: 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>
> 主题: Re: [PATCH] clk: imx: clk-imx8mm: fix memory leak issue in 'imx8mm_clocks_probe'
> 
> 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?
What do you mean by "coordinating with each other"?

regards,
Zhou Shide

  reply	other threads:[~2023-04-14  2:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  3:24 Zhou Shide
2023-04-13 19:06 ` Stephen Boyd
2023-04-14  2:02   ` 周师德 [this message]
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=5e18370b.3c8a8.1877d7fc98a.Coremail.u201911681@hust.edu.cn \
    --to=u201911681@hust.edu.cn \
    --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=sboyd@kernel.org \
    --cc=shawnguo@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®