From e752d9effff7c87c9f69f62c493d5ca5837d87f1 Mon Sep 17 00:00:00 2001 From: Mohana Datta Yelugoti Date: Wed, 26 Aug 2020 08:07:31 +0000 Subject: [PATCH] audio: src: update component's value validation logic In src component structure, for it to be valid, the source rate and sink rate values aren't supposed to be zero. The current logic check marks it as an error only if both are zero, but even if one is zero, it's an error. The new logic updates the check for the same. Signed-off-by: Mohana Datta Yelugoti --- src/audio/src/src.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 560324856815..be5aab4f2108 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -462,7 +462,7 @@ static struct comp_dev *src_new(const struct comp_driver *drv, comp_cl_info(&comp_src, "src_new()"); /* validate init data - either SRC sink or source rate must be set */ - if (ipc_src->source_rate == 0 && ipc_src->sink_rate == 0) { + if (ipc_src->source_rate == 0 || ipc_src->sink_rate == 0) { comp_cl_err(&comp_src, "src_new(): SRC sink and source rate are not set"); return NULL; }