From 9b51e3e0ca88ead0dcb0cb90e8779f21cc584c65 Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Sat, 21 Jul 2018 05:20:10 +0530 Subject: [PATCH] ASoC: audio-ext-clk: Replace clock dummy ops Replace clock framework's clock dummy ops with audio external clock ops to access correct structure that avoids out of bounds memory access. Change-Id: I51db63bba414cff0343cbf68e90b1e1bbf7929ac Signed-off-by: Sudheer Papothi --- asoc/codecs/audio-ext-clk-up.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/asoc/codecs/audio-ext-clk-up.c b/asoc/codecs/audio-ext-clk-up.c index 1bcdbe3d74..9f2e4022bc 100644 --- a/asoc/codecs/audio-ext-clk-up.c +++ b/asoc/codecs/audio-ext-clk-up.c @@ -144,6 +144,21 @@ static const char * const audio_ext_pmi_div_clk[] = { "pm6150_div_clk1", }; +static int audio_ext_clk_dummy_prepare(struct clk_hw *hw) +{ + return 0; +} + +static void audio_ext_clk_dummy_unprepare(struct clk_hw *hw) +{ + +} + +static const struct clk_ops audio_ext_clk_dummy_ops = { + .prepare = audio_ext_clk_dummy_prepare, + .unprepare = audio_ext_clk_dummy_unprepare, +}; + static struct audio_ext_clk audio_clk_array[] = { { .pnctrl_info = {NULL}, @@ -169,7 +184,7 @@ static struct audio_ext_clk audio_clk_array[] = { .parent_names = (const char *[]) { "ln_bb_clk2" }, .num_parents = 1, - .ops = &clk_dummy_ops, + .ops = &audio_ext_clk_dummy_ops, }, }, },