Skip to content

Commit 240cc97

Browse files
singalsulgirdwood
authored andcommitted
Audio: Module adapter: Fix return value when no prepare operation
The build of testbench for MTL platform simulation causes this build fail (rebuilt-testbench -p mtl): src/audio/module_adapter/module/generic.c:213:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (md->ops->prepare) { ^~~~~~~~~~~~~~~~ src/audio/module_adapter/module/generic.c:236:9: note: uninitialized use occurs here return ret; ^~~ Since it's a possibility to have a module without prepare() operation, the initialize to zero is added to avoid the return of undefined value. Reported-by: Marc Herbert <marc.herbert@intel.com> Signed-off-by: shastry <malladi.sastry@intel.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent fd61ed6 commit 240cc97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/audio/module_adapter/module/generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ int module_prepare(struct processing_module *mod,
198198
struct sof_source **sources, int num_of_sources,
199199
struct sof_sink **sinks, int num_of_sinks)
200200
{
201-
int ret;
201+
int ret = 0;
202202
struct module_data *md = &mod->priv;
203203
struct comp_dev *dev = mod->dev;
204204

0 commit comments

Comments
 (0)