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/4652/head
Christopher Haster 2017-06-27 15:39:44 -05:00
parent e907079456
commit a9f5d886fb
1 changed files with 2 additions and 2 deletions

View File

@ -216,8 +216,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: