Skip to content

Commit 128f29f

Browse files
author
Jyri Sarha
committed
Audio: Google rtc: Memory, blob, and fast_get allocs to module API
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends and remove all redundant rfree(), comp_data_blob_handler_free(), and fast_put() calls from module unload functions and init error branches. The change does not touch the google_rtc_audio_processing.h API or its mock implementation, that still uses rballoc() and rfree(). Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 02cb7c5 commit 128f29f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/audio/google/google_rtc_audio_processing.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,15 +512,15 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)
512512
comp_info(dev, "google_rtc_audio_processing_init()");
513513

514514
/* Create private component data */
515-
cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
515+
cd = mod_zalloc(mod, sizeof(*cd));
516516
if (!cd) {
517517
ret = -ENOMEM;
518518
goto fail;
519519
}
520520

521521
md->private = cd;
522522

523-
cd->tuning_handler = comp_data_blob_handler_new(dev);
523+
cd->tuning_handler = mod_data_blob_handler_new(mod);
524524
if (!cd->tuning_handler) {
525525
ret = -ENOMEM;
526526
goto fail;
@@ -585,8 +585,6 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)
585585
GoogleRtcAudioProcessingFree(cd->state);
586586
}
587587
GoogleRtcAudioProcessingDetachMemoryBuffer();
588-
comp_data_blob_handler_free(cd->tuning_handler);
589-
rfree(cd);
590588
}
591589

592590
return ret;
@@ -601,8 +599,6 @@ static int google_rtc_audio_processing_free(struct processing_module *mod)
601599
GoogleRtcAudioProcessingFree(cd->state);
602600
cd->state = NULL;
603601
GoogleRtcAudioProcessingDetachMemoryBuffer();
604-
comp_data_blob_handler_free(cd->tuning_handler);
605-
rfree(cd);
606602
return 0;
607603
}
608604

0 commit comments

Comments
 (0)