summaryrefslogtreecommitdiff
path: root/arch/mips/alchemy/common/clock.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-11-17 11:15:08 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-11-17 11:15:08 -0800
commited129cd75ac1073f32d04d0f2012ede40e86fb77 (patch)
tree28056fd9352da597cd2158c261aa45ddeb0ca95f /arch/mips/alchemy/common/clock.c
parentbe1dd6692adbdb1d70da47da124ac8376bba5ad5 (diff)
parentac3b57adf87ad9bac7e33ca26bbbb13fae1ed62b (diff)
Merge tag 'mips_fixes_5.10_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fixes from Thomas Bogendoerfer: - fix bug preventing booting on several platforms - fix for build error, when modules need has_transparent_hugepage - fix for memleak in alchemy clk setup * tag 'mips_fixes_5.10_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu MIPS: kernel: Fix for_each_memblock conversion MIPS: export has_transparent_hugepage() for modules
Diffstat (limited to 'arch/mips/alchemy/common/clock.c')
-rw-r--r--arch/mips/alchemy/common/clock.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c
index a95a894aceaf..f0c830337104 100644
--- a/arch/mips/alchemy/common/clock.c
+++ b/arch/mips/alchemy/common/clock.c
@@ -152,6 +152,7 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
{
struct clk_init_data id;
struct clk_hw *h;
+ struct clk *clk;
h = kzalloc(sizeof(*h), GFP_KERNEL);
if (!h)
@@ -164,7 +165,13 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
id.ops = &alchemy_clkops_cpu;
h->init = &id;
- return clk_register(NULL, h);
+ clk = clk_register(NULL, h);
+ if (IS_ERR(clk)) {
+ pr_err("failed to register clock\n");
+ kfree(h);
+ }
+
+ return clk;
}
/* AUXPLLs ************************************************************/