summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2013-01-22 08:06:36 -0800
committerBernard Xiong <[email protected]>2013-01-22 08:06:36 -0800
commitba245ae88046d0bd5ad421fe545c83986a69421b (patch)
treeda6afa66e009f81178aa9245858877ffb4a13063 /components
parentead6922231e807c2ae02f5c69378b041d0a37395 (diff)
parent821d0ac252f9c0f0c931e893ddc2865bbde6c22d (diff)
Merge pull request #20 from prife/simmerge
some bug fix after the recently merge from simmerge branch
Diffstat (limited to 'components')
-rw-r--r--components/dfs/filesystems/elmfat/dfs_elm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/dfs/filesystems/elmfat/dfs_elm.c b/components/dfs/filesystems/elmfat/dfs_elm.c
index c9fdfb9051..0b85b54810 100644
--- a/components/dfs/filesystems/elmfat/dfs_elm.c
+++ b/components/dfs/filesystems/elmfat/dfs_elm.c
@@ -123,7 +123,12 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
rt_snprintf(drive, sizeof(drive), "%d:/", index);
dir = (DIR *)rt_malloc(sizeof(DIR));
if (dir == RT_NULL)
+ {
+ f_mount((BYTE)index, RT_NULL);
+ disk[index] = RT_NULL;
+ rt_free(fat);
return -DFS_STATUS_ENOMEM;
+ }
/* open the root directory to test whether the fatfs is valid */
result = f_opendir(dir, drive);
@@ -137,6 +142,7 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
}
__err:
+ f_mount((BYTE)index, RT_NULL);
disk[index] = RT_NULL;
rt_free(fat);
return elm_result_to_dfs(result);