The cd->config could be passed as null pointer to eq_fir_setup() if the previous malloc() would fail.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com --- src/audio/eq_fir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/audio/eq_fir.c b/src/audio/eq_fir.c index 274393f..69e27fe 100644 --- a/src/audio/eq_fir.c +++ b/src/audio/eq_fir.c @@ -334,9 +334,10 @@ static int eq_fir_cmd(struct comp_dev *dev, int cmd, void *data) return -EINVAL;
cd->config = rmalloc(RZONE_RUNTIME, RFLAGS_NONE, bs); - if (cd->config != NULL) - memcpy(cd->config, blob->data, bs); + if (cd->config == NULL) + return -EINVAL;
+ memcpy(cd->config, blob->data, bs); eq_fir_setup(cd->fir, cd->config, source->params.pcm->channels); break; case COMP_CMD_MUTE: