Skip to content

Commit d8f93c0

Browse files
author
Jyri Sarha
committed
modules: Apparently asking 0 alignment is dangerous, use 4 as default
The current rballoc_align() implementation has this line: assert(IS_ALIGNED(mem, align)); Which will cause division by zero due to IS_ALIGNED() Zephyr implementation: define IS_ALIGNED(ptr, align) (((uintptr_t)(ptr)) % (align) == 0) So better use 4 as the default value. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent cb65c6a commit d8f93c0

File tree

1 file changed

+2
-2
lines changed
  • src/include/sof/audio/module_adapter/module

1 file changed

+2
-2
lines changed

src/include/sof/audio/module_adapter/module/generic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ int module_init(struct processing_module *mod);
191191
void *mod_balloc_align(struct processing_module *mod, size_t size, size_t alignment);
192192
static inline void *mod_balloc(struct processing_module *mod, size_t size)
193193
{
194-
return mod_balloc_align(mod, size, 0);
194+
return mod_balloc_align(mod, size, 4);
195195
}
196196

197197
void *mod_alloc_align(struct processing_module *mod, size_t size, size_t alignment);
198198
static inline void *mod_alloc(struct processing_module *mod, size_t size)
199199
{
200-
return mod_alloc_align(mod, size, 0);
200+
return mod_alloc_align(mod, size, 4);
201201
}
202202

203203
static inline void *mod_zalloc(struct processing_module *mod, size_t size)

0 commit comments

Comments
 (0)