aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk/rockchip/clk.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-07-20 16:08:14 +0800
committerAlex Shi <alex.shi@linaro.org>2016-07-20 16:08:14 +0800
commit1d508e233d21a7848cf54d7d03b40dac2d9ea873 (patch)
treeeec5222580c4bca752ae35d5cef3842166e6f8c8 /drivers/clk/rockchip/clk.c
parent439863d92fda525a8f3b326a24490e91c70f0496 (diff)
parent5880876e94699ce010554f483ccf0009997955ca (diff)
Merge remote-tracking branch 'lts/linux-4.1.y' into linux-linaro-lsk-v4.1lsk-v4.1-16.07
Conflicts: pick up 45d1abd9de arm64: Use PoU cache instr for I/D coherency in arch/arm64/mm/flush.c
Diffstat (limited to 'drivers/clk/rockchip/clk.c')
-rw-r--r--drivers/clk/rockchip/clk.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
index edb5d489ae61..3b9de3264534 100644
--- a/drivers/clk/rockchip/clk.c
+++ b/drivers/clk/rockchip/clk.c
@@ -70,7 +70,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
if (gate_offset >= 0) {
gate = kzalloc(sizeof(*gate), GFP_KERNEL);
if (!gate)
- return ERR_PTR(-ENOMEM);
+ goto err_gate;
gate->flags = gate_flags;
gate->reg = base + gate_offset;
@@ -82,7 +82,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
if (div_width > 0) {
div = kzalloc(sizeof(*div), GFP_KERNEL);
if (!div)
- return ERR_PTR(-ENOMEM);
+ goto err_div;
div->flags = div_flags;
div->reg = base + muxdiv_offset;
@@ -100,6 +100,11 @@ static struct clk *rockchip_clk_register_branch(const char *name,
flags);
return clk;
+err_div:
+ kfree(gate);
+err_gate:
+ kfree(mux);
+ return ERR_PTR(-ENOMEM);
}
static struct clk *rockchip_clk_register_frac_branch(const char *name,