OSDN Git Service

clk: renesas: rzg2l: Fix a double free on error
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 17 Jun 2021 14:14:11 +0000 (17:14 +0300)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 19 Jul 2021 08:53:52 +0000 (10:53 +0200)
commit36aaa3a0d9bc13e302dc146a20f022fb6891b605
tree18a6f11e181e4a910cc6a1a69b4e663a2dfce369
parent97c29755598f98c6c91f68f12bdd3f517e457890
clk: renesas: rzg2l: Fix a double free on error

The "pll_clk" and "clock" pointers are allocated with devm_kzalloc() so
freeing them with kfree() will lead to a double free.  This would only
happen if probe failed, and the system is not bootable.

Fixes: ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/YMtYs7LVveYH4eRe@mwanda
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/clk/renesas/renesas-rzg2l-cpg.c