mirror of https://github.com/thesofproject/sof.git
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:
parent
1b89167f51
commit
e7a339bd4c
|
@ -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);
|
sad->mod_handle = rballoc(0, SOF_MEM_CAPS_RAM, mem_sz);
|
||||||
if (!sad->mod_handle)
|
if (!sad->mod_handle)
|
||||||
goto err;
|
goto err;
|
||||||
|
memset(sad->mod_handle, 0, mem_sz);
|
||||||
|
|
||||||
hspk = sad->mod_handle;
|
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);
|
hspk->dsmhandle = rballoc(0, SOF_MEM_CAPS_RAM, size);
|
||||||
if (!hspk->dsmhandle)
|
if (!hspk->dsmhandle)
|
||||||
goto err;
|
goto err;
|
||||||
|
memset(hspk->dsmhandle, 0, size);
|
||||||
mem_sz += size;
|
mem_sz += size;
|
||||||
|
|
||||||
comp_dbg(dev, "[DSM] module:%p (%d bytes used)",
|
comp_dbg(dev, "[DSM] module:%p (%d bytes used)",
|
||||||
|
|
Loading…
Reference in New Issue