mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
sensors/ak09912: Ensure ak09912_dev_s zero in ak09912_register
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Alan Carvalho de Assis
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user