diff options
Diffstat (limited to 'drivers/clk/clk-mux.c')
-rw-r--r-- | drivers/clk/clk-mux.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index bd5e598b9f1e..6e58f11ab81f 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c | |||
@@ -94,9 +94,10 @@ struct clk *clk_register_mux(struct device *dev, const char *name, | |||
94 | u8 clk_mux_flags, spinlock_t *lock) | 94 | u8 clk_mux_flags, spinlock_t *lock) |
95 | { | 95 | { |
96 | struct clk_mux *mux; | 96 | struct clk_mux *mux; |
97 | struct clk *clk; | ||
97 | 98 | ||
99 | /* allocate the mux */ | ||
98 | mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL); | 100 | mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL); |
99 | |||
100 | if (!mux) { | 101 | if (!mux) { |
101 | pr_err("%s: could not allocate mux clk\n", __func__); | 102 | pr_err("%s: could not allocate mux clk\n", __func__); |
102 | return ERR_PTR(-ENOMEM); | 103 | return ERR_PTR(-ENOMEM); |
@@ -109,6 +110,11 @@ struct clk *clk_register_mux(struct device *dev, const char *name, | |||
109 | mux->flags = clk_mux_flags; | 110 | mux->flags = clk_mux_flags; |
110 | mux->lock = lock; | 111 | mux->lock = lock; |
111 | 112 | ||
112 | return clk_register(dev, name, &clk_mux_ops, &mux->hw, | 113 | clk = clk_register(dev, name, &clk_mux_ops, &mux->hw, |
113 | parent_names, num_parents, flags); | 114 | parent_names, num_parents, flags); |
115 | |||
116 | if (IS_ERR(clk)) | ||
117 | kfree(mux); | ||
118 | |||
119 | return clk; | ||
114 | } | 120 | } |