sensors/ak09912: Ensure ak09912_dev_s zero in ak09912_register

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-08-12 03:02:34 +08:00 committed by Alan Carvalho de Assis
parent 61ea875c94
commit ed786986ed
1 changed files with 1 additions and 1 deletions

View File

@ -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");