diff options
| author | 与非熊 <[email protected]> | 2026-06-22 13:53:20 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-06-22 16:41:29 +0800 |
| commit | eac6bff07ab818d74123542188f68d853b7b73f4 (patch) | |
| tree | 0581ff4367a79c71ae1ce65bebce22adda95b3d6 /components | |
| parent | abb08898b8190a5610cf7a3e651514099ded6d1c (diff) | |
[fix][elm]解决块设备扇区大小校验失败时存在的disk泄漏问题
Diffstat (limited to 'components')
| -rw-r--r-- | components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c b/components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c index 90b87a178b..cb1479f6ca 100644 --- a/components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c +++ b/components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c @@ -150,8 +150,6 @@ static int dfs_elm_mount(struct dfs_mnt *mnt, unsigned long rwflag, const void * } logic_nbr[0] = '0' + index; - /* save device */ - disk[index] = mnt->dev_id; /* check sector size */ if (rt_device_control(mnt->dev_id, RT_DEVICE_CTRL_BLK_GETGEOME, &geometry) == RT_EOK) { @@ -162,6 +160,8 @@ static int dfs_elm_mount(struct dfs_mnt *mnt, unsigned long rwflag, const void * return -EINVAL; } } + /* save device */ + disk[index] = mnt->dev_id; fat = (FATFS *)rt_malloc(sizeof(FATFS)); if (fat == RT_NULL) |
