]> git.baikalelectronics.ru Git - kernel.git/commit
clk: Unlink clock if failed to prepare or enable
authorMarc Zyngier <maz@kernel.org>
Tue, 5 May 2020 14:09:53 +0000 (15:09 +0100)
committerStephen Boyd <sboyd@kernel.org>
Tue, 5 May 2020 19:12:00 +0000 (12:12 -0700)
commit33eaf176f483a78ed373e9ffecbf9707f25e8b41
treea96b8b60c1687d35586a6729a470d9cc3254a0ef
parent5875ace78133467db9c07f9f976715c7500eadb4
clk: Unlink clock if failed to prepare or enable

On failing to prepare or enable a clock, remove the core structure
from the list it has been inserted as it is about to be freed.

This otherwise leads to random crashes when subsequent clocks get
registered, during which parsing of the clock tree becomes adventurous.

Observed with QEMU's RPi-3 emulation.

Fixes: 2cd26ccff6a4 ("clk: Don't try to enable critical clocks if prepare failed")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>
Link: https://lkml.kernel.org/r/20200505140953.409430-1-maz@kernel.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c