summaryrefslogtreecommitdiff
path: root/nuttx/drivers/usbhost/usbhost_skeleton.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_skeleton.c')
-rw-r--r--nuttx/drivers/usbhost/usbhost_skeleton.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_skeleton.c b/nuttx/drivers/usbhost/usbhost_skeleton.c
index efb7a58ba..c33dda586 100644
--- a/nuttx/drivers/usbhost/usbhost_skeleton.c
+++ b/nuttx/drivers/usbhost/usbhost_skeleton.c
@@ -47,6 +47,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs.h>
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
@@ -252,7 +253,7 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
DEBUGASSERT(!up_interrupt_context());
- priv = (FAR struct usbhost_state_s *)malloc(sizeof(struct usbhost_state_s));
+ priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}
@@ -275,12 +276,12 @@ static inline void usbhost_freeclass(FAR struct usbhost_state_s *class)
{
DEBUGASSERT(class != NULL);
- /* Free the class instance (calling sched_free() in case we are executing
- * from an interrupt handler.
+ /* Free the class instance (perhaps calling sched_free() in case we are
+ * executing from an interrupt handler.
*/
uvdbg("Freeing: %p\n", class);;
- free(class);
+ kfree(class);
}
/****************************************************************************