Skip to content

Commit 31ff3c4

Browse files
Jyri Sarhakv2019i
authored andcommitted
modules: Remove redundant mod_free() and mod_free_all() calls
Remove redundant mod_free() and mod_free_all() calls. The calls became redundant after mod_free_all() was added to module_adapter_free(). This change concerns only the modules that are already exclusively using mod_alloc() and friends from module API. Namely, Cadence Codec API (sof/audio/module_adapter/module/cadence.c) was left out even thou it uses mod_alloc() and friends, since it still also uses direct rballoc(), rzalloc(), rmalloc(), and rfree() calls. Cadence Codec API will be dealt with the rest of the modules that do not yet use module heap API. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 490b614 commit 31ff3c4

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

src/audio/codec/dts/dts.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,6 @@ static int dts_codec_free(struct processing_module *mod)
405405
if (ret)
406406
comp_err(dev, "dts_codec_free() failed %d %d", ret, dts_result);
407407

408-
mod_free_all(mod);
409-
410408
comp_dbg(dev, "dts_codec_free() done");
411409

412410
return ret;

src/audio/module_adapter/module/waves/waves.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,8 @@ static int waves_codec_init(struct processing_module *mod)
677677
memset(waves_codec, 0, sizeof(struct waves_codec_data));
678678
codec->private = waves_codec;
679679
ret = waves_effect_allocate(mod);
680-
if (ret) {
681-
mod_free(mod, waves_codec);
680+
if (ret)
682681
codec->private = NULL;
683-
}
684682
}
685683

686684
if (ret) {
@@ -862,7 +860,6 @@ static int waves_codec_reset(struct processing_module *mod)
862860

863861
static int waves_codec_free(struct processing_module *mod)
864862
{
865-
mod_free_all(mod);
866863
comp_dbg(mod->dev, "waves_codec_free()");
867864
return 0;
868865
}

0 commit comments

Comments
 (0)