sensors/ak09912: Ensure ak09912_dev_s zero in ak09912_register
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
61ea875c94
commit
ed786986ed
@ -676,7 +676,7 @@ int ak09912_register(FAR const char *devpath, FAR struct i2c_master_s *i2c)
|
|||||||
|
|
||||||
/* Initialize the AK09912 device structure */
|
/* Initialize the AK09912 device structure */
|
||||||
|
|
||||||
priv = kmm_malloc(sizeof(struct ak09912_dev_s));
|
priv = kmm_zalloc(sizeof(struct ak09912_dev_s));
|
||||||
if (!priv)
|
if (!priv)
|
||||||
{
|
{
|
||||||
snerr("Failed to allocate instance\n");
|
snerr("Failed to allocate instance\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user