Thread (3 messages) flat view 3 messages, 2 authors, 2021-06-17

Re: [PATCH] clk: renesas: fix a double free on error

From: Dan Carpenter <hidden>
Date: 2021-06-17 14:04:43
Also in: kernel-janitors, linux-renesas-soc

On Thu, Jun 17, 2021 at 03:45:50PM +0200, Geert Uytterhoeven wrote:
Hi Dan,

On Thu, Jun 17, 2021 at 3:38 PM Dan Carpenter [off-list ref] wrote:
quoted
The "clock" pointer is allocated with devm_kzalloc() so freeing it
here will lead to a double free.

Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC")
Signed-off-by: Dan Carpenter <redacted>
Thanks for your patch!

While the double free is unlikely to happen (the error is not
propagated upstream, and the driver cannot be unloaded), kernel
test robot reported two of these errors.  The other one is at line 202.
Care to fix that as well?
Yeah, sure.  I'll clean up the NULL vs error pointer mixing as well.

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help