Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/audio/google/google_ctc_audio_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,11 @@ static int ctc_free(struct processing_module *mod)
comp_info(mod->dev, "ctc_free()");

if (cd) {
rfree(cd->input);
rfree(cd->output);
mod_free(mod, cd->input);
mod_free(mod, cd->output);
GoogleCtcAudioProcessingFree(cd->state);
rfree(cd);
mod_data_blob_handler_free(mod, cd->tuning_handler);
mod_free(mod, cd);
module_set_private_data(mod, NULL);
}

Expand All @@ -265,7 +266,7 @@ static int ctc_init(struct processing_module *mod)
comp_info(dev, "ctc_init()");

/* Create private component data */
cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
cd = mod_zalloc(mod, sizeof(*cd));
if (!cd) {
comp_err(dev, "Failed to create component data");
ctc_free(mod);
Expand All @@ -277,20 +278,20 @@ static int ctc_init(struct processing_module *mod)
cd->chunk_frames = kChunkFrames;
buf_size = cd->chunk_frames * sizeof(cd->input[0]) * kMaxChannels;

cd->input = rballoc(SOF_MEM_FLAG_USER, buf_size);
cd->input = mod_balloc(mod, buf_size);
if (!cd->input) {
comp_err(dev, "Failed to allocate input buffer");
ctc_free(mod);
return -ENOMEM;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same problem with initialisation as in #10295

}
cd->output = rballoc(SOF_MEM_FLAG_USER, buf_size);
cd->output = mod_balloc(mod, buf_size);
if (!cd->output) {
comp_err(dev, "Failed to allocate output buffer");
ctc_free(mod);
return -ENOMEM;
}

cd->tuning_handler = comp_data_blob_handler_new(dev);
cd->tuning_handler = mod_data_blob_handler_new(mod);
if (!cd->tuning_handler) {
comp_err(dev, "Failed to create tuning handler");
ctc_free(mod);
Expand Down
12 changes: 6 additions & 6 deletions src/audio/google/google_rtc_audio_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)
comp_info(dev, "google_rtc_audio_processing_init()");

/* Create private component data */
cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
cd = mod_zalloc(mod, sizeof(*cd));
if (!cd) {
ret = -ENOMEM;
goto fail;
}

md->private = cd;

cd->tuning_handler = comp_data_blob_handler_new(dev);
cd->tuning_handler = mod_data_blob_handler_new(mod);
if (!cd->tuning_handler) {
ret = -ENOMEM;
goto fail;
Expand Down Expand Up @@ -585,8 +585,8 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)
GoogleRtcAudioProcessingFree(cd->state);
}
GoogleRtcAudioProcessingDetachMemoryBuffer();
comp_data_blob_handler_free(cd->tuning_handler);
rfree(cd);
mod_data_blob_handler_free(mod, cd->tuning_handler);
mod_free(mod, cd);
}

return ret;
Expand All @@ -601,8 +601,8 @@ static int google_rtc_audio_processing_free(struct processing_module *mod)
GoogleRtcAudioProcessingFree(cd->state);
cd->state = NULL;
GoogleRtcAudioProcessingDetachMemoryBuffer();
comp_data_blob_handler_free(cd->tuning_handler);
rfree(cd);
mod_data_blob_handler_free(mod, cd->tuning_handler);
mod_free(mod, cd);
return 0;
}

Expand Down
23 changes: 11 additions & 12 deletions src/audio/igo_nr/igo_nr.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <user/trace.h>
#include <sof/common.h>
#include <rtos/panic.h>
#include <rtos/alloc.h>
#include <rtos/init.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
Expand Down Expand Up @@ -421,7 +420,7 @@ static int igo_nr_init(struct processing_module *mod)
return -EINVAL;
}

cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
cd = mod_zalloc(mod, sizeof(*cd));
if (!cd)
return -ENOMEM;

Expand All @@ -433,18 +432,18 @@ static int igo_nr_init(struct processing_module *mod)
goto cd_fail;
}

cd->p_handle = rballoc(SOF_MEM_FLAG_USER, cd->igo_lib_info.handle_size);
cd->p_handle = mod_balloc(mod, cd->igo_lib_info.handle_size);
if (!cd->p_handle) {
comp_err(dev, "igo_handle memory rballoc error for size %d",
comp_err(dev, "igo_handle memory mod_balloc error for size %d",
cd->igo_lib_info.handle_size);
ret = -ENOMEM;
goto cd_fail;
}

/* Handler for configuration data */
cd->model_handler = comp_data_blob_handler_new(dev);
cd->model_handler = mod_data_blob_handler_new(mod);
if (!cd->model_handler) {
comp_err(dev, "comp_data_blob_handler_new() failed.");
comp_err(dev, "mod_data_blob_handler_new() failed.");
ret = -ENOMEM;
goto cd_fail2;
}
Expand All @@ -463,13 +462,13 @@ static int igo_nr_init(struct processing_module *mod)
return 0;

cd_fail3:
comp_data_blob_handler_free(cd->model_handler);
mod_data_blob_handler_free(mod, cd->model_handler);

cd_fail2:
rfree(cd->p_handle);
mod_free(mod, cd->p_handle);

cd_fail:
rfree(cd);
mod_free(mod, cd);
return ret;
}

Expand All @@ -479,10 +478,10 @@ static int igo_nr_free(struct processing_module *mod)

comp_info(mod->dev, "igo_nr_free()");

comp_data_blob_handler_free(cd->model_handler);
mod_data_blob_handler_free(mod, cd->model_handler);

rfree(cd->p_handle);
rfree(cd);
mod_free(mod, cd->p_handle);
mod_free(mod, cd);
return 0;
}

Expand Down
Loading