1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 06:53:52 +01:00

drivers/encx24j600: fix unaligned memory access

This commit is contained in:
Marian Buschsieweke 2021-11-06 20:32:46 +01:00
parent 26346188b9
commit 9f1cece6ee
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -326,7 +326,7 @@ static inline int _packets_available(encx24j600_t *dev)
static void _get_mac_addr(netdev_t *encdev, uint8_t* buf)
{
encx24j600_t * dev = (encx24j600_t *) encdev;
uint16_t *addr = (uint16_t *) buf;
uint16_t addr[3];
lock(dev);
@ -334,6 +334,8 @@ static void _get_mac_addr(netdev_t *encdev, uint8_t* buf)
addr[1] = reg_get(dev, ENC_MAADR2);
addr[2] = reg_get(dev, ENC_MAADR3);
memcpy(buf, addr, sizeof(addr));
unlock(dev);
}