Re: [PATCH] clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe

From: Kai Ma
Date: Mon May 29 2023 - 01:08:20 EST

On Thursday, May 18, 2023 6:34:38 PM CST Abel Vesa wrote:
> On 23-04-18 11:34:51, Kai Ma wrote:
> > Use devm_of_iomap() instead of of_iomap() to automatically
> > handle the unused ioremap region. If any error occurs, regions allocated by
> > kzalloc() will leak, but using devm_kzalloc() instead will automatically
> > free the memory using devm_kfree().
> >
> > Also, fix error handling of hws by adding unregister_hws label, which
> > unregisters remaining hws when iomap failed.
> >
> > Fixes: 7154b046d8f3 ("clk: imx: Add initial support for i.MXRT1050 clock driver")
> > Signed-off-by: Kai Ma <kaima@xxxxxxxxxxx>
> Reviewed-by: Abel Vesa <abel.vesa@xxxxxxxxxx>
> Stephen, can you apply this through clk-fixes?

Thanks for your review, I am glad to let you know that I am a student at a
university and we collaborate to contribute to the Linux kernel. Here we
have some similar patches for clk. Could you please take care of them?


Thank you very much!

Kai Ma

Attachment: signature.asc
Description: This is a digitally signed message part.