Fix allocated memory test
Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
parent
09146beee9
commit
9cfe255a81
@ -284,7 +284,7 @@ int a4988_register(FAR const char *devpath, FAR struct a4988_ops_s *ops)
|
||||
priv->ops = ops;
|
||||
|
||||
lower = kmm_malloc(sizeof(struct stepper_lowerhalf_s));
|
||||
if (priv == NULL)
|
||||
if (lower == NULL)
|
||||
{
|
||||
stperr("Failed to allocate instance\n");
|
||||
kmm_free(priv);
|
||||
|
@ -314,7 +314,7 @@ int drv8825_register(FAR const char *devpath, FAR struct drv8825_ops_s *ops)
|
||||
priv->ops = ops;
|
||||
|
||||
lower = kmm_malloc(sizeof(struct stepper_lowerhalf_s));
|
||||
if (priv == NULL)
|
||||
if (lower == NULL)
|
||||
{
|
||||
stperr("Failed to allocate instance\n");
|
||||
kmm_free(priv);
|
||||
|
Loading…
Reference in New Issue
Block a user