Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/dfs/dfs_v1/filesystems/elmfat/dfs_elm.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,9 @@ DRESULT disk_read(BYTE drv, BYTE *buff, DWORD sector, UINT count)
rt_size_t result;
rt_device_t device = disk[drv];

if (device == RT_NULL)
return RES_ERROR;

result = rt_device_read(device, sector, buff, count);
if (result == count)
{
Expand All @@ -923,6 +926,9 @@ DRESULT disk_write(BYTE drv, const BYTE *buff, DWORD sector, UINT count)
rt_size_t result;
rt_device_t device = disk[drv];

if (device == RT_NULL)
return RES_ERROR;

result = rt_device_write(device, sector, buff, count);
if (result == count)
{
Expand Down
6 changes: 6 additions & 0 deletions components/dfs/dfs_v2/filesystems/elmfat/dfs_elm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,9 @@ DRESULT disk_read(BYTE drv, BYTE *buff, DWORD sector, UINT count)
rt_size_t result;
rt_device_t device = disk[drv];

if (device == RT_NULL)
return RES_ERROR;

result = rt_device_read(device, sector, buff, count);
if (result == count)
{
Expand All @@ -1161,6 +1164,9 @@ DRESULT disk_write(BYTE drv, const BYTE *buff, DWORD sector, UINT count)
rt_size_t result;
rt_device_t device = disk[drv];

if (device == RT_NULL)
return RES_ERROR;

result = rt_device_write(device, sector, buff, count);
if (result == count)
{
Expand Down
Loading