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
Christopher Haster 2017-06-27 15:39:44 -05:00 committed by adbridge
parent a35baf2171
commit 94aea467c9
1 changed files with 2 additions and 2 deletions

View File

@ -219,8 +219,8 @@ DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
if (_ffs[pdrv] == NULL) {
return RES_NOTRDY;
} else {
DWORD size = _ffs[pdrv]->get_erase_size();
*((DWORD*)buff) = size;
WORD size = _ffs[pdrv]->get_erase_size();
*((WORD*)buff) = size;
return RES_OK;
}
case GET_BLOCK_SIZE: