summaryrefslogtreecommitdiff
path: root/nuttx/fs/fat/fs_fat32util.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/fs/fat/fs_fat32util.c')
-rw-r--r--nuttx/fs/fat/fs_fat32util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nuttx/fs/fat/fs_fat32util.c b/nuttx/fs/fat/fs_fat32util.c
index 3233ec707..aa327543b 100644
--- a/nuttx/fs/fat/fs_fat32util.c
+++ b/nuttx/fs/fat/fs_fat32util.c
@@ -56,6 +56,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs.h>
#include <nuttx/fat.h>
@@ -626,7 +627,7 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable)
/* Allocate a buffer to hold one hardware sector */
- fs->fs_buffer = (uint8_t*)malloc(fs->fs_hwsectorsize);
+ fs->fs_buffer = (uint8_t*)kmalloc(fs->fs_hwsectorsize);
if (!fs->fs_buffer)
{
ret = -ENOMEM;
@@ -724,7 +725,7 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable)
return OK;
errout_with_buffer:
- free(fs->fs_buffer);
+ kfree(fs->fs_buffer);
fs->fs_buffer = 0;
errout:
fs->fs_mounted = false;