drivers/mtd_flashpage: require read source & destination alignment
This commit is contained in:
parent
0b79ae3524
commit
127b46eea3
@ -44,6 +44,12 @@ static int _read(mtd_dev_t *dev, void *buf, uint32_t addr, uint32_t size)
|
|||||||
|
|
||||||
(void)dev;
|
(void)dev;
|
||||||
|
|
||||||
|
#ifndef CPU_HAS_UNALIGNED_ACCESS
|
||||||
|
if (addr % sizeof(uword_t)) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uword_t dst_addr = addr;
|
uword_t dst_addr = addr;
|
||||||
memcpy(buf, (void *)dst_addr, size);
|
memcpy(buf, (void *)dst_addr, size);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user