[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdVrngq2P+uPq79Rgi=Ba8hYBftG8ztSGXxyTvppqwYc1Q@mail.gmail.com>
Date: Mon, 10 Nov 2025 17:37:23 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>,
linux-renesas-soc@...r.kernel.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] clk: renesas: r9a06g032: Fix memory leak in error path
On Thu, 30 Oct 2025 at 07:16, Haotian Zhang <vulab@...as.ac.cn> wrote:
> The current code uses of_iomap() to map registers but never calls
> iounmap() on any error path after the mapping. This causes a memory
> leak when probe fails after successful ioremap, for example when
> of_clk_add_provider() or r9a06g032_add_clk_domain() fails.
>
> Replace of_iomap() with devm_of_iomap() to automatically unmap the
> region on probe failure. Update the error check accordingly to use
> IS_ERR() and PTR_ERR() since devm_of_iomap() returns ERR_PTR on error.
>
> Fixes: 4c3d88526eba ("clk: renesas: Renesas R9A06G032 clock driver")
> Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
i.e. will queue in renesas-clk for v6.19.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists