ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()
[sfrench/cifs-2.6.git] / sound / soc / samsung / i2s.c
index 10a4da06c0a1477388758f30b2aaf61ae8a5ef12..d7e7f4244d387c0ef7b24595d8bb2c7b26a58db1 100644 (file)
@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
                        }
 
                        ret = clk_prepare_enable(i2s->op_clk);
-                       if (ret)
+                       if (ret) {
+                               clk_put(i2s->op_clk);
+                               i2s->op_clk = NULL;
                                goto err;
+                       }
                        i2s->rclk_srcrate = clk_get_rate(i2s->op_clk);
 
                        /* Over-ride the other's */