dts: handle zero config size case in set_configuration

The generic module_set_configuration function returns 0 early when
the coming config size is 0. In aspect of DTS module, receiving 0
from module_set_configuration call means either config is obtained
succesfully or no config (size is 0). The present code doesn't
handle the latter case.

This commit handles the case in DTS module by early return.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
This commit is contained in:
Pin-chih Lin 2022-12-20 21:13:52 +08:00 committed by Liam Girdwood
parent fc497eb448
commit 5270e631c3
1 changed files with 4 additions and 0 deletions

View File

@ -435,6 +435,10 @@ dts_codec_set_configuration(struct processing_module *mod, uint32_t config_id,
md->state < MODULE_INITIALIZED)
return 0;
/* return if configuration size is 0 */
if (!md->new_cfg_size)
return 0;
/* whole configuration received, apply it now */
ret = dts_codec_apply_config(mod);
if (ret) {