eq-iir: eq_iir_verify_params() has to acquire buffers

Failing to properly acquire buffer objects for access leads to a
CI regression.

BugLink: https://github.com/thesofproject/sof/issues/6075
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-08-05 15:01:44 +02:00 committed by Liam Girdwood
parent 0ba90d8e2a
commit 904a633351
1 changed files with 9 additions and 4 deletions

View File

@ -671,8 +671,8 @@ static void eq_iir_free(struct comp_dev *dev)
static int eq_iir_verify_params(struct comp_dev *dev, static int eq_iir_verify_params(struct comp_dev *dev,
struct sof_ipc_stream_params *params) struct sof_ipc_stream_params *params)
{ {
struct comp_buffer *sourceb; struct comp_buffer *sourceb, *sinkb;
struct comp_buffer *sinkb; struct comp_buffer __sparse_cache *source_c, *sink_c;
uint32_t buffer_flag; uint32_t buffer_flag;
int ret; int ret;
@ -683,6 +683,8 @@ static int eq_iir_verify_params(struct comp_dev *dev,
sink_list); sink_list);
sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, sinkb = list_first_item(&dev->bsink_list, struct comp_buffer,
source_list); source_list);
source_c = buffer_acquire(sourceb);
sink_c = buffer_acquire(sinkb);
/* we check whether we can support frame_fmt conversion (whether we have /* we check whether we can support frame_fmt conversion (whether we have
* such conversion function) due to source and sink buffer frame_fmt's. * such conversion function) due to source and sink buffer frame_fmt's.
@ -690,11 +692,14 @@ static int eq_iir_verify_params(struct comp_dev *dev,
* pcm frame_fmt and will not make any conversion (sink and source * pcm frame_fmt and will not make any conversion (sink and source
* frame_fmt will be equal). * frame_fmt will be equal).
*/ */
buffer_flag = eq_iir_find_func(sourceb->stream.frame_fmt, buffer_flag = eq_iir_find_func(source_c->stream.frame_fmt,
sinkb->stream.frame_fmt, fm_configured, sink_c->stream.frame_fmt, fm_configured,
ARRAY_SIZE(fm_configured)) ? ARRAY_SIZE(fm_configured)) ?
BUFF_PARAMS_FRAME_FMT : 0; BUFF_PARAMS_FRAME_FMT : 0;
buffer_release(sink_c);
buffer_release(source_c);
ret = comp_verify_params(dev, buffer_flag, params); ret = comp_verify_params(dev, buffer_flag, params);
if (ret < 0) { if (ret < 0) {
comp_err(dev, "eq_iir_verify_params(): comp_verify_params() failed."); comp_err(dev, "eq_iir_verify_params(): comp_verify_params() failed.");