diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2018-05-13 13:17:04 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2018-05-15 13:37:03 -0700 |
commit | 823b68ea43d8b8641e06ef5db49b164aa10d3901 (patch) | |
tree | 0bf373807c0d68253adf2663ee8edc9137ba608f /drivers | |
parent | 77dc00205cd5108cb2699e37c843f99220e24636 (diff) | |
download | linux-823b68ea43d8b8641e06ef5db49b164aa10d3901.tar.bz2 |
clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
We allocate some memory which is neither used, nor referenced by anything.
So axe it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/clk-stm32mp1.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c index 35dabf1df39a..e68cb478f21f 100644 --- a/drivers/clk/clk-stm32mp1.c +++ b/drivers/clk/clk-stm32mp1.c @@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev, spinlock_t *lock) { struct clk_init_data init = { NULL }; - struct clk_gate *gate; struct clk_hw *hw; int ret; - gate = kzalloc(sizeof(*gate), GFP_KERNEL); - if (!gate) - return ERR_PTR(-ENOMEM); - init.name = name; init.parent_names = &parent_name; init.num_parents = 1; @@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev, hw->init = &init; ret = clk_hw_register(dev, hw); - if (ret) { - kfree(gate); + if (ret) hw = ERR_PTR(ret); - } return hw; } |