mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 18:20:54 +07:00
clk: ti: consider the fact that of_clk_get() might return an error
I "forgot" to update the dtb and the kernel crashed: |Unable to handle kernel NULL pointer dereference at virtual address 0000002e |PC is at __clk_get_flags+0x4/0xc |LR is at ti_dt_clockdomains_setup+0x70/0xe8 because I did not have the clock nodes. of_clk_get() returns an error pointer which is not checked here. Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Tero Kristo <t-kristo@ti.com>
This commit is contained in:
parent
73b5d5f711
commit
319f1276f9
@ -36,6 +36,11 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
|
||||
|
||||
for (i = 0; i < num_clks; i++) {
|
||||
clk = of_clk_get(node, i);
|
||||
if (IS_ERR(clk)) {
|
||||
pr_err("%s: Failed get %s' clock nr %d (%ld)\n",
|
||||
__func__, node->full_name, i, PTR_ERR(clk));
|
||||
continue;
|
||||
}
|
||||
if (__clk_get_flags(clk) & CLK_IS_BASIC) {
|
||||
pr_warn("can't setup clkdm for basic clk %s\n",
|
||||
__clk_get_name(clk));
|
||||
|
Loading…
Reference in New Issue
Block a user