[Sound-open-firmware] [PATCH] volume: use rzalloc for component new

Keyon Jie yang.jie at linux.intel.com
Tue Jan 10 10:01:03 CET 2017


Replace rmalloc() with rzalloc() to make sure the new
allocated structs are clear to all 0s.

Signed-off-by: Keyon Jie <yang.jie at 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;
-- 
2.5.0



More information about the Sound-open-firmware mailing list