From a134878e46666307013084c32a9f7826bdfc58ad Mon Sep 17 00:00:00 2001 From: Przemyslaw Blaszkowski Date: Fri, 3 Mar 2023 14:43:30 +0100 Subject: [PATCH] copier: fix format check for set_attenuation Fix format validation in set_attenuation function. In previous implementation, bitdepth was compared to sink->buffer_fmt value, which is an enum sof_ipc_buffer_format (interleaved or not). Format bitdepth is represented by stream.frame_fmt (enum sof_ipc_frame), so it should be compared to this value. Signed-off-by: Przemyslaw Blaszkowski --- src/audio/copier/copier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index cf73cbcaa..28c690965 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -1484,7 +1484,7 @@ static int set_attenuation(struct comp_dev *dev, uint32_t data_offset, const cha list_for_item(sink_list, &dev->bsink_list) { sink = container_of(sink_list, struct comp_buffer, source_list); - if (sink->buffer_fmt < SOF_IPC_FRAME_S24_4LE) { + if (sink->stream.frame_fmt < SOF_IPC_FRAME_S24_4LE) { comp_err(dev, "sink %d in format %d isn't supported by attenuation", sink->id, sink->buffer_fmt); return -EINVAL;