mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-02 14:23:19 +08:00
[fix][elm]解决块设备扇区大小校验失败时存在的disk泄漏问题
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user