mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
Fix allocated memory test
Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
committed by
Mateusz Szafoni
parent
09146beee9
commit
9cfe255a81
@@ -284,7 +284,7 @@ int a4988_register(FAR const char *devpath, FAR struct a4988_ops_s *ops)
|
|||||||
priv->ops = ops;
|
priv->ops = ops;
|
||||||
|
|
||||||
lower = kmm_malloc(sizeof(struct stepper_lowerhalf_s));
|
lower = kmm_malloc(sizeof(struct stepper_lowerhalf_s));
|
||||||
if (priv == NULL)
|
if (lower == NULL)
|
||||||
{
|
{
|
||||||
stperr("Failed to allocate instance\n");
|
stperr("Failed to allocate instance\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ int drv8825_register(FAR const char *devpath, FAR struct drv8825_ops_s *ops)
|
|||||||
priv->ops = ops;
|
priv->ops = ops;
|
||||||
|
|
||||||
lower = kmm_malloc(sizeof(struct stepper_lowerhalf_s));
|
lower = kmm_malloc(sizeof(struct stepper_lowerhalf_s));
|
||||||
if (priv == NULL)
|
if (lower == NULL)
|
||||||
{
|
{
|
||||||
stperr("Failed to allocate instance\n");
|
stperr("Failed to allocate instance\n");
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
|
|||||||
Reference in New Issue
Block a user