module_adapter: avoid module init crash in case of ipc data invalid

In ipc3 module creation, it is possible that ipc data
is invalid or corrupted, in this case, module init may crash.
This patch is adding error handling to avoid crash.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
This commit is contained in:
Baofeng Tian 2023-07-31 16:08:02 +08:00 committed by Kai Vehmanen
parent f222070b6c
commit e847c8b270
1 changed files with 2 additions and 0 deletions

View File

@ -130,6 +130,8 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv,
goto err;
}
dst->init_data = dst->data;
} else {
goto err;
}
#else
if (drv->type == SOF_COMP_MODULE_ADAPTER) {