Skip to content

Commit 6cb32cd

Browse files
Jyri Sarhakv2019i
authored andcommitted
smart-amp-test: Use module API for all memory allocations
Use module API mod_zalloc() for memory allocation and mod_data_blob_handler_new() for blob handler allocation and corresponding module API functions for freeing them. Signed-off-by: Jyri Sarha <[email protected]>
1 parent 9ff0a7a commit 6cb32cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/samples/audio/smart_amp_test_ipc4.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ static int smart_amp_init(struct processing_module *mod)
6262

6363
comp_dbg(dev, "entry");
6464

65-
sad = rzalloc(SOF_MEM_FLAG_USER, sizeof(*sad));
65+
sad = mod_zalloc(mod, sizeof(*sad));
6666
if (!sad)
6767
return -ENOMEM;
6868

6969
mod_data->private = sad;
7070

7171
/* component model data handler */
72-
sad->model_handler = comp_data_blob_handler_new(dev);
72+
sad->model_handler = mod_data_blob_handler_new(mod);
7373
if (!sad->model_handler) {
7474
ret = -ENOMEM;
7575
goto sad_fail;
@@ -93,8 +93,8 @@ static int smart_amp_init(struct processing_module *mod)
9393
return 0;
9494

9595
sad_fail:
96-
comp_data_blob_handler_free(sad->model_handler);
97-
rfree(sad);
96+
mod_data_blob_handler_free(mod, sad->model_handler);
97+
mod_free(mod, sad);
9898

9999
return ret;
100100
}
@@ -158,8 +158,8 @@ static int smart_amp_free(struct processing_module *mod)
158158
struct comp_dev *dev = mod->dev;
159159

160160
comp_dbg(dev, "smart_amp_free()");
161-
comp_data_blob_handler_free(sad->model_handler);
162-
rfree(sad);
161+
mod_data_blob_handler_free(mod, sad->model_handler);
162+
mod_free(mod, sad);
163163

164164
return 0;
165165
}

0 commit comments

Comments
 (0)