mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
drivers/can/mcp2515.c: Use kmm_zalloc to allocate device state structure.
This commit is contained in:
committed by
Gregory Nutt
parent
d09dc74488
commit
527317b6ca
@@ -2570,7 +2570,7 @@ FAR struct can_dev_s *mcp2515_initialize(FAR struct mcp2515_can_s *mcp2515can)
|
|||||||
|
|
||||||
/* Allocate a CAN Device structure */
|
/* Allocate a CAN Device structure */
|
||||||
|
|
||||||
dev = (FAR struct can_dev_s *)kmm_malloc(sizeof(struct can_dev_s));
|
dev = (FAR struct can_dev_s *)kmm_zalloc(sizeof(struct can_dev_s));
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
{
|
{
|
||||||
canerr("ERROR: Failed to allocate instance of can_dev_s!\n");
|
canerr("ERROR: Failed to allocate instance of can_dev_s!\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user