[Sound-open-firmware] [PATCH] 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 --- src/audio/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/audio/volume.c b/src/audio/volume.c index e2badb8..4b5b2e3 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -306,11 +306,11 @@ static struct comp_dev *volume_new(uint32_t type, uint32_t index, struct comp_data *cd; int i;
- dev = rmalloc(RZONE_MODULE, RMOD_SYS, sizeof(*dev)); + dev = rzalloc(RZONE_MODULE, RMOD_SYS, sizeof(*dev)); if (dev == NULL) return NULL;
- cd = rmalloc(RZONE_MODULE, RMOD_SYS, sizeof(*cd)); + cd = rzalloc(RZONE_MODULE, RMOD_SYS, sizeof(*cd)); if (cd == NULL) { rfree(RZONE_MODULE, RMOD_SYS, dev); return NULL;
On Tue, 2017-01-10 at 17:01 +0800, Keyon Jie wrote:
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
src/audio/volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/audio/volume.c b/src/audio/volume.c index e2badb8..4b5b2e3 100644 --- a/src/audio/volume.c +++ b/src/audio/volume.c @@ -306,11 +306,11 @@ static struct comp_dev *volume_new(uint32_t type, uint32_t index, struct comp_data *cd; int i;
- dev = rmalloc(RZONE_MODULE, RMOD_SYS, sizeof(*dev));
- dev = rzalloc(RZONE_MODULE, RMOD_SYS, sizeof(*dev)); if (dev == NULL) return NULL;
- cd = rmalloc(RZONE_MODULE, RMOD_SYS, sizeof(*cd));
- cd = rzalloc(RZONE_MODULE, RMOD_SYS, sizeof(*cd)); if (cd == NULL) { rfree(RZONE_MODULE, RMOD_SYS, dev); return NULL;
Applied.
participants (2)
-
Keyon Jie
-
Liam Girdwood