summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author与非熊 <[email protected]>2026-06-22 16:19:54 +0800
committerRbb666 <[email protected]>2026-06-22 16:41:29 +0800
commita828a3116dfedb35af043ef4ed66338ace900194 (patch)
treed224acbd3ecc99531c59e1f3506bf4e3f72c9667 /components
parenteac6bff07ab818d74123542188f68d853b7b73f4 (diff)
[fix][dfsv1][elm]解决块设备扇区大小校验失败时存在的disk泄漏问题
Diffstat (limited to 'components')
-rw-r--r--components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c b/components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c
index effd1bcd7c..afb2a0d46d 100644
--- a/components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c
+++ b/components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c
@@ -117,8 +117,6 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
return -ENOENT;
logic_nbr[0] = '0' + index;
- /* save device */
- disk[index] = fs->dev_id;
/* check sector size */
if (rt_device_control(fs->dev_id, RT_DEVICE_CTRL_BLK_GETGEOME, &geometry) == RT_EOK)
{
@@ -128,6 +126,8 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
return -EINVAL;
}
}
+ /* save device */
+ disk[index] = fs->dev_id;
fat = (FATFS *)rt_malloc(sizeof(FATFS));
if (fat == RT_NULL)