[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1667a487-5cca-a9b2-47b3-9e6d06fc3548@oss.nxp.com>
Date: Fri, 28 Apr 2023 15:49:18 +0800
From: Peng Fan <peng.fan@....nxp.com>
To: Zhanhao Hu <zero12113@...t.edu.cn>,
Abel Vesa <abelvesa@...nel.org>, Peng Fan <peng.fan@....com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>
Cc: hust-os-kernel-patches@...glegroups.com,
Dongliang Mu <dzm91@...t.edu.cn>, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk: imx93: fix memory leak and missing unwind goto in
imx93_clocks_probe
On 4/26/2023 10:25 PM, Zhanhao Hu wrote:
> In function probe(), it returns directly without unregistered hws
> when error occurs.
>
> I fix this by adding 'goto unregister_hws;' on line 295 and
> line 310.
>
> Besides, I use devm_kzalloc() instead of kzalloc() to automatically
> free the memory using devm_kfree() when error occurs.
>
> Similarly, I replace of_iomap() with devm_of_iomap() to automatically
> handle the unused ioremap region. So I delete 'iounmap(anatop_base);'
> in unregister_hws.
>
> Fixes: 24defbe194b6 ("clk: imx: add i.MX93 clk")
> Signed-off-by: Zhanhao Hu<zero12113@...t.edu.cn>
> Reviewed-by: Dongliang Mu<dzm91@...t.edu.cn>
Actually the clk driver should never fail, otherwise the system will not
boot. But anyway it is fine to include the changes:
Reviewed-by: Peng Fan <peng.fan@....com>
Powered by blists - more mailing lists