Skip to content

Commit a828a31

Browse files
Unbear-HzRbb666
authored andcommitted
[fix][dfsv1][elm]解决块设备扇区大小校验失败时存在的disk泄漏问题
1 parent eac6bff commit a828a31

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • components/dfs/dfs_v1/filesystems/elmfat

components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
117117
return -ENOENT;
118118
logic_nbr[0] = '0' + index;
119119

120-
/* save device */
121-
disk[index] = fs->dev_id;
122120
/* check sector size */
123121
if (rt_device_control(fs->dev_id, RT_DEVICE_CTRL_BLK_GETGEOME, &geometry) == RT_EOK)
124122
{
@@ -128,6 +126,8 @@ int dfs_elm_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *d
128126
return -EINVAL;
129127
}
130128
}
129+
/* save device */
130+
disk[index] = fs->dev_id;
131131

132132
fat = (FATFS *)rt_malloc(sizeof(FATFS));
133133
if (fat == RT_NULL)

0 commit comments

Comments
 (0)