Skip to content

Commit 20bf9a3

Browse files
author
Jyri Sarha
committed
Audio: Aria: All memory allocations through module API
Allocate all memory through module API mod_alloc() and friends and remove all redundant rfree() calls from module unload functions and init error branches. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 9eabb32 commit 20bf9a3

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/audio/aria/aria.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <sof/audio/pipeline.h>
1010
#include <rtos/panic.h>
1111
#include <sof/ipc/msg.h>
12-
#include <rtos/alloc.h>
1312
#include <rtos/cache.h>
1413
#include <rtos/init.h>
1514
#include <sof/lib/notifier.h>
@@ -126,7 +125,7 @@ static int aria_init(struct processing_module *mod)
126125
list_init(&dev->bsource_list);
127126
list_init(&dev->bsink_list);
128127

129-
cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
128+
cd = mod_zalloc(mod, sizeof(*cd));
130129
if (!cd) {
131130
return -ENOMEM;
132131
}
@@ -145,10 +144,9 @@ static int aria_init(struct processing_module *mod)
145144
}
146145
mod_data->private = cd;
147146

148-
buf = rballoc(SOF_MEM_FLAG_USER, req_mem);
147+
buf = mod_alloc(mod, req_mem);
149148

150149
if (!buf) {
151-
rfree(cd);
152150
comp_err(dev, "allocation failed for size %d", req_mem);
153151
return -ENOMEM;
154152
}
@@ -158,10 +156,6 @@ static int aria_init(struct processing_module *mod)
158156

159157
static int aria_free(struct processing_module *mod)
160158
{
161-
struct aria_data *cd = module_get_private_data(mod);
162-
163-
rfree(cd->data_addr);
164-
rfree(cd);
165159
return 0;
166160
}
167161

0 commit comments

Comments
 (0)