mirror of https://github.com/thesofproject/sof.git
volume: use rzalloc for component new
Replace rmalloc() with rzalloc() to make sure the new allocated structs are clear to all 0s. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
parent
75eee17e0c
commit
b9bd368186
|
@ -306,11 +306,11 @@ static struct comp_dev *volume_new(uint32_t type, uint32_t index,
|
||||||
struct comp_data *cd;
|
struct comp_data *cd;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dev = rmalloc(RZONE_MODULE, RMOD_SYS, sizeof(*dev));
|
dev = rzalloc(RZONE_MODULE, RMOD_SYS, sizeof(*dev));
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
cd = rmalloc(RZONE_MODULE, RMOD_SYS, sizeof(*cd));
|
cd = rzalloc(RZONE_MODULE, RMOD_SYS, sizeof(*cd));
|
||||||
if (cd == NULL) {
|
if (cd == NULL) {
|
||||||
rfree(RZONE_MODULE, RMOD_SYS, dev);
|
rfree(RZONE_MODULE, RMOD_SYS, dev);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue