mirror of https://github.com/ARMmbed/mbed-os.git
fatfs: Fix unaligned access in disk_ioctl
Unlike the other disk_ioctl options, GET_SECTOR_SIZE is interpreted as a 16-bit WORD, instead of a 32-bit DWORD. This caused an unaligned access error on M0 platforms.pull/4760/head
parent
a35baf2171
commit
94aea467c9
|
@ -219,8 +219,8 @@ DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
|
||||||
if (_ffs[pdrv] == NULL) {
|
if (_ffs[pdrv] == NULL) {
|
||||||
return RES_NOTRDY;
|
return RES_NOTRDY;
|
||||||
} else {
|
} else {
|
||||||
DWORD size = _ffs[pdrv]->get_erase_size();
|
WORD size = _ffs[pdrv]->get_erase_size();
|
||||||
*((DWORD*)buff) = size;
|
*((WORD*)buff) = size;
|
||||||
return RES_OK;
|
return RES_OK;
|
||||||
}
|
}
|
||||||
case GET_BLOCK_SIZE:
|
case GET_BLOCK_SIZE:
|
||||||
|
|
Loading…
Reference in New Issue