From 374f8b31d5f695d7eb8f54f2fe6fcaa526f29b9d Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 6 Sep 2018 12:16:29 +0300 Subject: [PATCH] EQ IIR: Fix just introduced bug in eq_iir_cache() The component data pointer need to be retrieved after dev data has been invalidated. If wrong order the cd may be set to garbage. Signed-off-by: Seppo Ingalsuo --- src/audio/eq_iir.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/audio/eq_iir.c b/src/audio/eq_iir.c index e848055fa..0b5941582 100644 --- a/src/audio/eq_iir.c +++ b/src/audio/eq_iir.c @@ -564,12 +564,13 @@ static int eq_iir_reset(struct comp_dev *dev) static void eq_iir_cache(struct comp_dev *dev, int cmd) { - struct comp_data *cd = comp_get_drvdata(dev); + struct comp_data *cd; switch (cmd) { case COMP_CACHE_WRITEBACK_INV: trace_eq("wtb"); + cd = comp_get_drvdata(dev); if (cd->config) dcache_writeback_invalidate_region(cd->config, cd->config->size); @@ -586,6 +587,11 @@ static void eq_iir_cache(struct comp_dev *dev, int cmd) trace_eq("inv"); dcache_invalidate_region(dev, sizeof(*dev)); + + /* Note: The component data need to be retrieved after + * the dev data has been invalidated. + */ + cd = comp_get_drvdata(dev); dcache_invalidate_region(cd, sizeof(*cd)); if (cd->iir_delay)