From ed786986ed0e196a5a4fedfef19c353c859ce10c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Wed, 12 Aug 2020 03:02:34 +0800 Subject: [PATCH] sensors/ak09912: Ensure ak09912_dev_s zero in ak09912_register Signed-off-by: Xiang Xiao --- drivers/sensors/ak09912.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sensors/ak09912.c b/drivers/sensors/ak09912.c index 3dacff0ea3..890976e41c 100644 --- a/drivers/sensors/ak09912.c +++ b/drivers/sensors/ak09912.c @@ -676,7 +676,7 @@ int ak09912_register(FAR const char *devpath, FAR struct i2c_master_s *i2c) /* Initialize the AK09912 device structure */ - priv = kmm_malloc(sizeof(struct ak09912_dev_s)); + priv = kmm_zalloc(sizeof(struct ak09912_dev_s)); if (!priv) { snerr("Failed to allocate instance\n");