diff options
| author | 2026-09-17 10:29:24 +0000 | |
|---|---|---|
| committer | 2026-09-25 15:33:43 +0200 | |
| commit | 94edcda45d888c3bb1310de11e10e4537c166f00 (patch) | |
| tree | ad405a46c15f7525c1531ca087cbd2d835df2a65 /scripts/Makefile.thinlto | |
| parent | mtd: rawnand: nuvoton: fix clock cleanup on probe failure (diff) | |
mtd: rawnand: atmel: Fix MCK clock leak in atmel_nand_controller_init()
atmel_nand_controller_init() takes a reference to the MCK clock with
of_clk_get() and keeps it in nc->mck for the lifetime of the
controller. If the "atmel,smc" phandle is missing or the SMC regmap
cannot be obtained afterwards, the error path jumps to out_release_dma
which only releases the DMA channel, so the clock reference is leaked.
The callers return the error directly and never run
atmel_nand_controller_cleanup(), where the clock is normally put.
Release the reference on those error paths. The path on which
of_clk_get() itself fails keeps jumping to out_release_dma, as nc->mck
only holds an error pointer there.
Fixes: f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
