smart amp: memory reset after allocation

Added memset by zero after memory allocation.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
This commit is contained in:
Ryan Lee 2020-11-16 14:27:54 -08:00 committed by Liam Girdwood
parent 1b89167f51
commit e7a339bd4c
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,7 @@ static inline int smart_amp_alloc_memory(struct smart_amp_data *sad,
sad->mod_handle = rballoc(0, SOF_MEM_CAPS_RAM, mem_sz);
if (!sad->mod_handle)
goto err;
memset(sad->mod_handle, 0, mem_sz);
hspk = sad->mod_handle;
@ -160,6 +161,7 @@ static inline int smart_amp_alloc_memory(struct smart_amp_data *sad,
hspk->dsmhandle = rballoc(0, SOF_MEM_CAPS_RAM, size);
if (!hspk->dsmhandle)
goto err;
memset(hspk->dsmhandle, 0, size);
mem_sz += size;
comp_dbg(dev, "[DSM] module:%p (%d bytes used)",